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

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.

Related

IIS: Parser Error Message: Could not create type

I am trying to build a simple web service in C# using VS2015 to be hosted on Windows Server 2012R2.
I have the code written and it works properly when hosted in the Visual Studio debugger. The debugger will launch IE and give me the UI to test the simple methods in my code. I can enter a temperature in Celsius and get back the temperature in Farentheit. So my understanding is that my code itself is working.
However, when I publish my project and attempt to load it in IE, I get:
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not create type 'TestAutomation.AutomationInterface'.
Source Error:
Line 1: <%# WebService Language="C#" CodeBehind="~/App_Code/WebService.cs" Class="TestAutomation.AutomationInterface" %>
Source File: /TestToolsAutomation/AutomationInterface.asmx Line: 1
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.81.0
I am publishing my project by going to Build -> Publish Web App. I am selecting "File System" as my publish method and am publishing to "C:\inetpub\wwwroot\MyAppName" in the Debug configuration with no check boxes in the File Publish Options. When I publish, I have the following files in the MyAppName folder:
-AutomationInterface.asmx
-Web.config
\App_Code
WebService.cs
The obvious issue I see here is that there is no .dll file created with my compiled code. I'm far from an IIS expert, but isn't this supposed to be created the first time a user requests the page?
I then re-published and checked "Precompile during publishing" in the file options. When I do this, a \bin folder is created with files "App_Code.compiled" and "App_Code.dll" files. However, I get the same error in the browser.
Because my code works in the VS debugger but not when hosted in IIS, I suspect the problem is on the IIS side of things, but I'm not 100% certain of that.
When I request the IIS page in IE, I get an event 1310 with source "ASP.NET 4.0.3.30319.0" in the application event log that says "Event code: 3006
Event message: A parser error has occurred" along with a stack trace that shows a bunch of System.Web.Compilation functions.
I have searched for this error on Stack Overflow and other sites, but none of the suggested solutions appear to solve my particular problem.
I would appreciate any help the community could offer.
UPDATE: I enabled failed request tracing on the server. It appears that the error happens here:
154. view trace
Warning
-MODULE_SET_RESPONSE_ERROR_STATUS
ModuleName
ManagedPipelineHandler
Notification
MAP_REQUEST_HANDLER
HttpStatus
500
HttpReason
Internal Server Error
HttpSubStatus
0
ErrorCode
The operation completed successfully.
(0x0)
ConfigExceptionInfo
ManagedPipelineHandler
I lack the background to fully understand what IIS is trying to tell me. Any tips would be appreciated.
After struggling with this for hours and making all kinds of settings changes, and uninstalling and reinstalling IIS several times, I finally solved this.
I had to right-click on the folder in which I published my files in IIS Manager and select "Convert to Application." It's now working!
Here are a few possible ideas to explore:
Have you looked at the permissions for the account that the Application Pool in IIS is using to run this? There can be ASP.Net Temporary files that aren't being generated that could be an issue here.
Is ASP.Net registered with IIS? I've remembered more than a few times to have to run "aspnet_regiis -i" on servers to install the ASP.Net part so that it'll be present within IIS.
Is IIS configured to allow ASP.Net requests? In the IIS Manager on the machine level there is an "ISAPI and CGI Restrictions" to note.
Update: Perhaps you could look at the configuration for the Application Pool and see which .Net version it is using and whether it is integrated or classic mode. Those would be the next level of things to examine.

Deploy ASP MVC in virtual directory

I have existing silverlight app which works as IIS application. And i need to deploy ASP MVC app as a part of this (don't ask me why) in virtual directory, not like new IIS application.
I use IIS 6.
I create new virtual directory in existing iis application and use path to ASP project folder as physical path of this virtual directory. But i get error
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 'C:\Users\Alina\Desktop\MVCApp' because
access is denied.
Source Error:
[No relevant source lines]
Is it possible to deploy ASP MVC application in virtual directory?
How to do this right?
Yeah, that should be possible. I'm guessing whatever service account your deployment process is running as doesn't have permission to write to C:\Users\Alina\Desktop\MVCApp.
To prove that out, you could modify permissions on that folder to allow 'Everyone' write access. If that works, figure out what account your process is running as, and grant that read/write/whatever, and remove the 'Everyone' access.
That should get your deployment situation fixed. I can't speak to how the two apps will run side by side. I'd need more info.

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.

ASP.NET virtual directory error

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.

Visual Studio Web Deployment project breaks ASPNET account permissions

I have built an ASP.NET web application with Visual Studio 2008 and target framework version 2.0. I have created a Web Setup project to deploy this at multiple target OSes.
For the setup project, I have written a custom action which gets executed on "OnCommitting" event. This custom action adds wildcard script mapping for routing all requests through ASP.NET engine.
FileMon suggests that an error occurs while creating a file in the following directory:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
The user account which was attempting this action was IWAM_<host name>.
The problem is after running this setup, if I try to access any url on the newly installed site, I received the error message:
Server Error in '/myapp' Application.
Failed to access IIS metabase.
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.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.
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.
I have already tried these options after 2 days of googling:
Run aspnet_regiis -i
Run aspnet_regiis -ga \ASPNET
Run aspnet_regiis -u and then aspnet_regiis -i
Option 3 has worked for me as of now, but, I want avoid using this, since, my web app will be deployed on a machine which might already be hosting some other app on IIS and I do not want to disturb these apps.
Can anyone suggest me a workaround for this?
B.T.W. my current system has .Net framework 3.5 and VS2008 installed on Win XP SP3 and IIS 5.1.
Thanks,
Vamyip
Your best bet is a custom bit of script in the installer package that checks permissions and then runs the command based on that information.
On a server OS this shouldn't be necessary since the default user for the application group will be in the IIS_WPG and have permissions to the temp directories. Windows XP has a bugged up version of IIS that is non-standard and doesn't follow all the rules. If your expected deployment environment is Windows Server 2003 or better then your installer should work as-is.

Resources