I have installed IIS and registered asp .net worker process on many machines now. But today while setting up and my new laptop I recieved two weird errors. The first one was
Event Source: ASP.NET 2.0.50727.0
Failed to initialize the AppDomain:/LM/W3SVC/1/Root/WebSite1
Exception: System.IO.FileLoadException
Message: Could not load file or assembly ‘System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. Access is denied.
StackTrace: at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String typeName)
at System.AppDomain.CreateInstance(String assemblyName, String typeName)
at System.AppDomain.CreateInstance(String assemblyName, String typeName)
at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
Followed by two more errors
Failed to execute the request because the ASP.NET process identity does not have read permissions to the global assembly cache. Error: 0x80070005 Access is denied.
and
aspnet_wp.exe (PID: 3720) stopped unexpectedly.
Upon some investigations I found out that this error occurs if you do not restart the machine after installing IIS. What I did wrong was I installed IIS and immediately after that installed Visual Studio which must have registered the asp .net 2.0 on IIS. To overcome the problem I took the following steps
- Uninstalled the IIS
- Restarted the machine
- Installed the IIS
- Restarted the machine
- Re-register the asp.net : using aspnet_regiis.exe -i
While this solved this problem, I then started to encounter another weird error, which I could not believe. All I was seein g when I used to run an asp.net application locally was Server not available error.
When I checked the system event logs I saw an error entry
Event Type: Error
Event Source: W3SVC
Event Category: None
Event ID: 115
Date: 24/09/2007
Time: 5:44:08 PM
User: N/A
Computer: BITG022-NB
Description:
The service could not bind instance 1. The data is the error code.
For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.
This error is caused and will occur if some application is already running and utilising Port 80,which is the default Http port. In my case I was running skype; In skype there is an option where you can use. Check the image below for reference.
January 22, 2008 at 5:51 pm
Did you try by just adding ASPNET user account default permission into your website folder? Sometimes, when you use Visual Studio folders on “my documents”, VS inherits security permissions from your “my documents” folder and then failed when trying to load app domain….
June 4, 2008 at 3:12 pm
Thank you Fernando, I ran into this issue and sure enough the NTFS permissions on the virtual directory folder were all messed up for some reason. I never would have thought to look at that without your suggestion.
September 10, 2008 at 5:22 am
i run into the same problem and i did what Fernando said, and solve the problem.
Thanks to u.
October 21, 2008 at 3:59 am
Adding the Network Service account with read/write right access to the website root folder fixed it for me. I had already tried re registering .net 2.0 & restarting the box, so maybe they help too 🙂
December 9, 2008 at 10:45 pm
I managed to skip a few steps there. ASPNET_REGIIS can usually fix the problem without need for restart.
Minimum Permissions on web directory:
IUSR_ Read
ASPNET_USER Read & Execute
December 9, 2008 at 10:46 pm
— No HTML Encoding on the above post
Should say IUSR_<Machine name> Read
January 14, 2009 at 9:30 pm
I had similar problem and fixed it by only re-registering ASP.NET using aspnet_regiis.exe -i
March 24, 2009 at 8:56 am
I got the same issue and i did what Fernando said, and solve the problem.
Thanks you.
April 3, 2009 at 11:40 pm
For me, this started after it had been working.
But I had done something that affected permissions.
adding IIS_WPG and IUSR_DADDOO (my domain is DADDOO), to the directory solved it. Blasted permissions!
May 8, 2009 at 3:44 pm
This gave me enough information to figure it out. I had to copy the permissions from another ASP.NET site that I had that was working to get the permissions correct.
Basically I needed to add permissions for ASP.NET, NETWORK SERVICES, IIS_WPG. Once I added the correct permissions, then things worked out.
I am thinking that the upgarde to ASP.NET 3.5 SP1 may have reset some permissions.
May 22, 2009 at 4:18 pm
Thank you Fernando.
August 1, 2009 at 5:25 am
Thank you so much for this, my problem was also permissions to the virtual directory. I granted IIS_WPG, NETWORK SERVICE, IUSR_Computername, ASP.NET all Read/Write and now all is well.
March 24, 2011 at 9:49 pm
Thank you Fernando. I searched and tried many other solutions. But your solution rocks! Thanks
August 31, 2011 at 7:19 pm
thought I would share this. This happened to me this morning. Lost half a day trying to figure it out. Turns out, it was because I shared the folder with the Services were deployed to.
July 29, 2013 at 11:47 pm
Hi everyone, it’s my first pay a quick visit at this website, and post is genuinely fruitful in favor of me, keep up posting such posts.
August 2, 2013 at 5:32 pm
I do agree with all the ideas you have offered in your
post. They’re really convincing and can certainly work. Nonetheless, the posts are very quick for starters. Could you please prolong them a bit from next time? Thank you for the post.