ASP.NET virtual directory error - asp.net

I set up virtual directory in IIS 6. The asp.net setting for my application pool is 4.0.
When I try to access my site I get the following error.
Server Application Unavailable
The web application you are attempting to access on this web server is
currently unavailable. Please hit the "Refresh" button in your web
browser to retry your request.
Administrator Note: An error message detailing the cause of this
specific request failure can be found in the application event log of
the web server. Please review this log entry to discover what caused
this error to occur.
When I check the event application log I get the error below.
Failed to execute request because the App-Domain could not be created. Error: 0x80070005 Access is denied.
It looks like some sort of permissions error but I can't figure out what. Anyone have any ideas?
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Use ProcMon from Microsoft to trace the file access of your web server worker process (aspnet_wp.exe on XP, w3wp.exe on Win7, 2003, 2008). If you filter where Process Name contains one of those two EXE names, you will eventually see an ACCESS DENIED entry in the status column. This will tell you what folder/file that your web server app cannot access or open.
Tip: for easier reading of results, turn off the registry and network tracing in ProcMon before doing your test.

You can try giving the IIS_WPG group (or whatever group the application is running as) read/write access to you app directory and see if it helps.

Your pool is set as .NET 4 framework but is your application set to using .NET 4?
Verify the ASP.NET tab is set to correction version on your virtual directory properties:
Also check to see that your ASP.NET user has the correct access by:
Right click the website folder in IIS
Select Permissions
Select Network Service
Permit read access to the user that the ASP.NET process runs as.
You are probably using a custom user or else the persmissions would most likely be correct out of the box.

Related

IIS 10 getting 401 unauthorized

Deploying an asp.net project on local IIS server as a release version. Getting 401 unauthorized error on API call (allow anonymous enabled). Server runs with administrator user principal. This principal has all the permissions. And the project declared as application with correct .net library. The only thing I can't change is read only flag on the project directory. Anyone can help? Nothing in google resources worked...
Update: After a lot of searching and digging, I found a solution:
IIS Application basic settings - The default settings is to run application with Application pool user, which is usually limited with it's files access permissions. So the idea is to run application with administrator user.
Run as - enter administrator user name and password
Application pool type - The default application pool type is 2 and sometimes new .NET libraries are not accessible. So you have to add all the missing ASP.NET types to IIS.
Usually ASP.Net version suppose to be classic, in this case application works fast. Otherwise application refresh time may take long period.
Local folder permission - add local administrator, that you defined on IIS settings, and grand him all permissions to the folder recursively
SQL Server Management- the default server authentication is Windows Authentication, make it SQL Server and Windows Authentication mode
Add new user to the server and grand him all the permission to the database
Add this user to database Users and change the SQL connection string at the project accordingly. This way you prevent application pull trying to connect with database with it's user
Just posting this here as I went around in circles trying to diagnose an intermittent 401 error.
I had a virtual sub directory within the web application that referenced an external folder which was out of the directory tree so had different folder permissions.
Any scripts that referenced this folder failed - while others ran completely fine.

80070005 Access is denied,when asp.net website with crystal report is deployed on dedicated server

I have an asp.net application which is displaying the report using crystal report.The application is working properly on my local PC.I deployed this application on our dedicated server and also installed crystal report run time engine on dedicated server.when i try to press the report in order to see the report,i am getting the above error.I changed the permission of folder "C:\Windows\Temp" to full controll(by choosing property of "temp" folder,full controll permission for all users(IIS-users,network..etc)).I am not sure whether this is the right way to give full control permission to this folder(i am not that much aware about networking concepts).But i am still getting the same error.The error is:
Retrieving the COM class factory for component with CLSID
{4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} failed due to the following
error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005
(E_ACCESSDENIED)).
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: Retrieving the
COM class factory for component with CLSID
{4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} failed due to the following
error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005
(E_ACCESSDENIED)).
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 , 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.
I have the same problem on a client's windows server 2003 machine running IIS6. Their server is very locked-down compared to normal servers, and something in that locking-down is probably the problem. I haven't experienced this problem on dozens of other clients' servers. I haven't solved the problem yet but here are some steps from what I've learned so far...
First thing to do is double-check which Application Pool your app is running under, and then check which Identity the App Pool is using (e.g. Network Service or Application Pool Identity or...). This is important to ensure you're giving permissions to the right user. Don't go any further until you're sure about this.
Next check if you're using IIS Impersonation (probably you're not unless you know what it is). This is where the application pool is sort-of running under the identity of the user ... this would only be the case if you're using Windows Authentication and in the web.config you have <identity impersonate="true" />. If you are using Impersonation then probably you have to give end users all the necessary file and/or COM access. If not (as in my case) it should just be a matter of checking the permissions are right for your application pool's user or IIS users group.
Once you know the right identity for permissions, try these steps:
If it's a 64-bit machine check you have Enable 32-bit applications enabled for the Application Pool (or that you have the 64-bit runtime installed)
Check the Application Pool identity has access to the C:\Windows\Temp folder (you've mentioned you've done this but I thought I'd list it for anyone else encountering the problem).
Check the Application Pool identity has access to the Crystal Reports folder, e.g. C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\. You can find the folder by opening regedit.exe and navigate to HKEY_CLASSES_ROOT\CLSID\{4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B}\InProcServer32. Get the path from the (default) value for that registry key and check the permissions on the parent folder for that path. Try giving Full Control to the folder to the right identity to see if that fixes the problem.
I'm not sure if this is relevant, but possibly adding <startup useLegacyV2RuntimeActivationPolicy="true"> to the web.config might help ... it was suggested in this post relating to a different COM application having similar problems so worth a go? So you'd add this inside the tag within web.config:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
Check the COM permissions on the server:
open Component Services from Control Panel > Administrative Tools
expand Component Services > Computers > My Computer then right-click > properties
click on the COM Security tab
In the Launch and Activation Permissions click on the Edit Default... button
Check the Launch and Activation Permissions permissions listed. If your app pool user isn't listed can try adding it with all 4 Allow permissions and retest. If that doesn't solve the problem then undo any changes.
If none of this has solved it then I suggest downloading Process Monitor and try to determine what it's trying to do that hits an Access Denied. This is the next step for me on the problem so if I find anything out I'll update this answer.
I just moved my web site to the default application pool and it workded.
I configured 32bit applications to enabled and indentity to NetworkService.
if you are running 64bit
C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64\sacommlayer.dll
right click and give read/write permission to specific user and then restart IIS problem will be solved.

Upgrading to 2K8 Server, An error occurred loading a configuration file: Failed to start monitoring changes to '\\networkshare'

I moved my site off of a 2k3 server over to a 2k8 server. The site has a virtual directory pointed to a network share which has different credentials than the one used by the site. I set the virtual directory to use the correct credentials and it can browse the share fine through explorer, but when I try to load files (images, etc) through a browser I get the following asp.net error:
Server Error in '/' Application.
Configuration Error Description: An error occurred during the
processing of a configuration file required to service this request.
Please review the specific error details below and modify your
configuration file appropriately.
Parser Error Message: An error occurred loading a configuration file:
Failed to start monitoring changes to '\\networkshare'.
Source Error:
[No relevant source lines]
Source File: \\networkshare\web.config Line: 0
Version Information: Microsoft .NET Framework Version:2.0.50727.5456;
ASP.NET Version:2.0.50727.5456
The network share does not have a web.config.
I tried the solution provided here, but that did not solve the issue and this site isn't using impersonation. Do I need to enable impersonation? This was working correctly on win2k3.
OK, so based on our comments it sounds like this is either a share permissions problem or an NTFS permissions problem (same resolution, different dialog).
In IIS6 you typically had the worker process running as NETWORK SERVICE and that's what you would give permissions to to access shares and files on the network.
In IIS7.5 the application pools now run under an AppPool identity, one specific to the application pool that the website is running under. This link should be helpful: http://learn.iis.net/page.aspx/624/application-pool-identities/
As a quick fix (although I recommend reading up on it) though, you can go into the application pool, go to advanced properties, and set the identity back to NETWORK SERVICE.

COM Applications not working

Our Test web server recently went down and we lost COM+ Applications installations. I am trying to reinstall the COM Applications. I have the installed the COM Applications and have the Identity set to run as Local Service. I have Security set to Perform access checks at the process and component level. The activation type is Server Application.
Environment:
Windows Server 2003
Classic ASP
I have verified that ASP is installed and works. I get a 500 Internal Server error when the page gets to a point to call CreateObject.
There must be a security setting somewhere that I am missing. I have tried giving Local Service Account and Network Service account full permissions on the root folder housing the .dll's.
Can't pinpoint it because the possible causes are legion.
There should be a setting in ASP that will report the HRESULT of the failed CreateObject call, instead of a useless 500 - Internal Error. From there, it should be easier to go on.
Aren't you unsure about LocalService, too? Shouldn't it be NetworkService instead?
Sorry that this is rather meager.
Found the problem. We had to go into IIS, view the website properties, go to the Home Directory, Click on Configuration and then the Options tab and finally check the "Enable Parent Path" checkbox.

ASP.NET App Exports to Excel (or not in this case)

Exising .net 2 app migrated to .net 4 and moved to an IIS7 Windows 2008 R2 server.
We used to be able to run some code on the web page to export some stuff to excel.
Now, when we do... we get the following error:
The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {00024500-0000-0000-C000-000000000046} and APPID
Unavailable to the user d"omain\username" SID (S-1-5-21-2084383492-816144152-925700815-4150) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.
Any thoughts?
I did wonder if it may be to do with the authenticated user being on a different domain to the webserver - where we see this error??
Try following this resolution:
Microsoft Support
I believe that the basics of the error are the same. The user you are trying to run the DCOm component as does not have permission to start it.
Restarted the web server and this error no longer appears... I get another error when I try and do the workbook save... I'll post another question on that.
Thanks for your help

Resources