Community
Showing results for 
Search instead for 
Do you mean 
Reply

Access to the path 'C:\...' is denied

New Member
Posts: 5
Country: Canada

Access to the path 'C:\...' is denied

First here is my setup:
Act! Premium Version 16.2.14.0
Windows Server 2003 Enterprise Edition Service Pack 2
Visual Studio 2010 Premium
.NET 4.0 targeting x86 build
The server's IIS manager for this web app is configured for .NET 4.0

Scenario:
I am creating an ASP.NET Web Application and publishing it to the Windows Server 2003. Everything works as expected when I run my Web Application locally for debug purposes on my machine using Visual Studio. However when deployed on the server I get the following error message when trying to go to the home page of my web application (BTW the project is called Yeti). Let me know if you have any suggestions or require more info to help me solve this?

Error:
Server Error in '/Yeti' Application.
 Access to the path 'C:\Documents and Settings\Default User\Application Data\ACT\ACT Data\Preferences' 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\Application Data\ACT\ACT Data\Preferences' 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 and IIS 7, and the configured application pool identity on IIS 7.5) 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.

Stack Trace:


[UnauthorizedAccessException: Access to the path 'C:\Documents and Settings\Default User\Application Data\ACT\ACT Data\Preferences' is denied.]
   Act.Framework.ActFramework.FailLogOn(Exception ex, TraceCategory tCat, TraceLevel tLevel) +75
   Act.Framework.ActFramework.LogOn(String userName, String password, String databaseType, String databaseHost, String databaseName, Boolean fireEvents, Boolean suppressTierCheck, Boolean suppressSchemaCheck, Boolean suppressLicenseCheck, Boolean allowTrialModeDeparture, LogonTrack tracklogon) +2941
   Act.Framework.ActFramework.LogOn(String userName, String password, String databaseType, String databaseHost, String databaseName, Boolean fireEvents, LogonTrack tracklogon) +124
   Act.Framework.ActFramework.LogOn(String userName, String password, String databaseType, String databaseHost, String databaseName, LogonTrack tracklogon) +113
   Act.Framework.ActFramework.LogOn(String xmlPADFile, String userName, String password) +129
   Act.ActClass..ctor() in C:\Code\Yeti\Yeti\Act.cs:23
   Act.ActTools._CreateCELAMemberLibraryIDSet() in C:\Code\Yeti\Yeti\Act.cs:163
   Act.ActTools..cctor() in C:\Code\Yeti\Yeti\Act.cs:157

[TypeInitializationException: The type initializer for 'Act.ActTools' threw an exception.]
   Act.ActTools.get_CELAMemberLibraryIDSet() in C:\Code\Yeti\Yeti\Act.cs:182
   Yeti.Home.LoadGridViewDataAndBind() in C:\Code\Yeti\Yeti\Home.aspx.cs:40
   Yeti.Home.Page_Load(Object sender, EventArgs e) in C:\Code\Yeti\Yeti\Home.aspx.cs:29
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

Nickel Contributor
Posts: 175
Country: USA

Re: Access to the path 'C:\...' is denied


JimRaynor wrote:


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 and IIS 7, and the configured application pool identity on IIS 7.5) 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.


 

This is a permissions issue. ASP.NET usually runs under a service account. The accounts are actually listed in what you posted. To get the correct account, you need to look at what account is used for the application pool you are running your website in on IIS. Once you have that, you can go to the location you are trying to access, and set up the proper read/write permissions to that folder for the account. If you only need read permissions, that's all you should give.

Copper Super Contributor
Posts: 52
Country: United_Kingdom

Re: Access to the path 'C:\...' is denied

[ Edited ]

Jim,

 

I've seen this message before on numerous occasions. It is permissions related. 

 

Take a look at my post here:

http://community.act.com/t5/Act-Developer-s-Forum/ASP-NET-web-applications-and-the-Act-Framework/td-...

 

It provides information on IIS configuration (Although the exact steps are IIS7 and newer). Hopefully, this will give you a little nudge in the right direction.

 

Kind regards,

 

 

Russell 

 

 

New Member
Posts: 5
Country: Canada

Re: Access to the path 'C:\...' is denied

Thank you for your reply. The problem is that the path 'C:\Documents and Settings\Default User\Application Data\ACT\ACT Data\Preferences' does not exist on the server machine. I have done a custom install of ACT so that the database is not included with the install. The user setting during the installation was set to allow all users of the machine access to Act.

 

I understand giving the application access to the folders that it uses but why is ACT trying to access folders that don't even exist?

 

The content of the 'C:\Documents and Settings\Default User\Application Data' folder is:

Identities

McAfee

Microsoft

 

That's it, there is no ACT folder in there. If I go to 'C:\Documents and Settings\SPECIFIC_USER\Application Data' (where SPECIFIC_USER is my windows login) then I can find an ACT folder in there.

Copper Super Contributor
Posts: 52
Country: United_Kingdom

Re: Access to the path 'C:\...' is denied

[ Edited ]

Hi Jim,

 

In honesty I don't know why the application requests access to that location. From what I've seen it doesn't seem to matter whether the directory exists or not.

 

I'll log this as a defect with the development team and post the defect number once I have it.

 

Regards,

 

 

Russell 

Copper Super Contributor
Posts: 52
Country: United_Kingdom

Re: Access to the path 'C:\...' is denied

Defect #104260

SDK - ASP.NET - "Access to the path 'C:\Documents and Settings\Default User\Application Data\ACT\ACT Data\Preferences' is denied."
New Member
Posts: 5
Country: Canada

Re: Access to the path 'C:\...' is denied

Thank you for your help. In that case I have a few other questions.

 

- How to check/follow the status of the defect

- How are defects fixed? (hotfix or service pack)

- Is there a way to check when the next hotfix/service pack is coming up and what is included?

- Is there a workaround that I can use to get my project to work on the server?

Nickel Contributor
Posts: 175
Country: USA

Re: Access to the path 'C:\...' is denied

Jim,

 

In regards to your last question about the workaround, I believe more information is going to be needed. Could you please verify the following? The web server has ACT installed with no database. A different server has ACT installed with the database (henceforth: database server). The PAD file is pointing to the database server. Is this correct?

 

Besides the above, could you please provide a code snippet of your login code (around line 23 in the Act.cs file)? Since you are using this LogOn overload:

   Act.Framework.ActFramework.LogOn(String xmlPADFile, String userName, String password)

could you please provide where the PAD file is located? Is it on the web server, the database server or some other server? Is the web server part of the same domain as the database server, or is it in a DMZ? Likewise for the server with the PAD file if it is on a 3rd server.

 

I could be completely wrong here, as I don't have much information, but based on what I can infer from these posts and making some assumptions, my initial impression is that a local service account is probably trying to access a file not on the same domain during the ACT.Logon() call. When the login fails because of this, ACT falls back to the default user setup, which doesn't exist in your case because it was never installed with the database.

New Member
Posts: 5
Country: Canada

Re: Access to the path 'C:\...' is denied

Hi,

alright here is the setup:

 

A. My local machine: Act installed with NO database and NO PAD file

B. Web Server: Act installed with NO database and NO PAD file

C. Database Server: Act installed WITH database and WITH PAD file

 

Both the web server and database server are on the same side of the firewall, on the same domain. Keep in mind I can run the code no problem locally on my machine using Visual Studio Debug. So the code is the same on A as it is on B.

 

The error occurs on the line with _actFwk.LogOn. Here is the piece of code:

 

namespace Act

{

   public class ActClass:IDisposable

   {

       ActFramework _actFwk = new ActFramework();

 

       public ActClass()

       {

           _actFwk.LogOn((@"\\libptpr01\ACT2014Demo-database files\ACT2014Demo.pad"), "SomeLogin", "SomePassword");

       }

 

       public ActFramework Framework { get { return _actFwk; } }

...

Nickel Contributor
Posts: 175
Country: USA

Re: Access to the path 'C:\...' is denied

Thanks for the information. I'm guessing that your domain account has read/write privileges (if not full admin) to both the web and database servers. This is the account being used when your run in debug mode in Visual Studio, so there is no issue. Once you put it on the web server, and the code runs from there, it is using the account that is set up in IIS to run the ASP.NET service. This is normally just a local service account (non-domain), so there is no way it is going to have any privileges on a different computer. You could change it to a domain account, but that is a huge security risk, even more so if it is a domain admin account.

 

I recall other people trying to do similar things, and it usually wasn't very pretty. Most of time it required the ACT/Database server to have web server capabilities, in the very least, to provide a web service to the actual, public-facing, web server. The web service would be the middle-ware to interact with ACT. That is to get around all of the account/permission issues that arise from having the different servers. There might be a cleaner way, I just don't recall seeing any.