Access to the path 'C:\Documents and Settings\Default User\Local Settings\Ap
hi my dear fast report team :
i uploaded my web site to a host and when i was trying to open a page that contains FastReportViewer , so i got this error :
Server Error in '/' Application.
Access to the path 'C:\Documents and Settings\Default User\Local Settings\Application Data\FastReport\' is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path 'C:\Documents and Settings\Default User\Local Settings\Application Data\FastReport\' is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
==================================================================
in local every thing is ok - but after upload i got that error...
how can i fix this problem?
best regards
i uploaded my web site to a host and when i was trying to open a page that contains FastReportViewer , so i got this error :
Server Error in '/' Application.
Access to the path 'C:\Documents and Settings\Default User\Local Settings\Application Data\FastReport\' is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path 'C:\Documents and Settings\Default User\Local Settings\Application Data\FastReport\' is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
==================================================================
in local every thing is ok - but after upload i got that error...
how can i fix this problem?
best regards
Comments
FastReport is trying to read its configuration file. You have to disable it with the following code:
FastReport.Utils.Config.WebMode = true;
You need to execute this code before you access the Report class. When you use the WebReport component, this is not required.
really really thanks for your attention ...
i made a sample project for test and it's code behind is like this :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
FastReport.Utils.Config.WebMode = true;
SqlDataSource1.SelectCommand = "sp_4Rep_Personel_SelectAllByCo_IDActive";
SqlDataSource1.SelectParameters.Clear();
SessionParameter Co_ID = new SessionParameter("Co_ID", System.Data.DbType.Int32, "Co_ID");
Co_ID.DefaultValue= "23";
SqlDataSource1.SelectParameters.Add(Co_ID);
WebReport1.ReportFile = "~/ReportingUsers/Files/Untitled.frx";
WebReport1.Refresh();
}
}
}
i uploaded that project , but problem still exists...
NOTICE :
>>>>>>>>>> plz attention to LocalizationFile at below (aspx code)
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
<%@ Register assembly="FastReport" namespace="FastReport.Web" tagprefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:DarmanByMajidConnectionString %>"
SelectCommand="sp_4Rep_Personel_SelectAllByCo_IDActive"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:SessionParameter DefaultValue="23" Name="Co_ID" SessionField="Co_ID"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<cc1:WebReport ID="WebReport1" runat="server"
ReportDataSources="SqlDataSource1"
ReportResourceString=""
LocalizationFile="~/ReportingUsers/Localization/Persian.frl" ReportFile="" />
</div>
</form>
</body>
</html>
it seems this problem is for LocalizationFile...
i used LocalizationFile Just For My WebReoprtViewer Menu...
How Can I Fix This Problem?
thanks A Lot
Best Regards
when i remove localizationfile in aspx code every thing become ok....
setting of localizationfile forces webreport1 to make a config file ...
is it possible to change the path of config file in code behind or another place?
best regards
hi my dear friend
where can i download daily build?
If you are a registered user, you may download it from your control panel on our website. Trial version may be downloaded here:
http://www.fast-report.com/en/download/fas...t-download.html
Then change from false to true the Enable 32-bit Applications's value.
I got rid of this problem in this way.