Last post Jan 19, 2010 10:27 AM by kaw296
Oct 27, 2009 03:51 PM|kaw296|LINK
I have instances of VS2005 SP1 and VS2008 SP1 recently installed on my new laptop. I'm in the process of moving applications and dev software from my old machine (lease is up) to the new one. I have two web applications, both using Framework 2.0, that I've
loaded and built. Both web apps (one developed in 2005, the other in 2008, but both Framework 2.0) throw a "Server Application Unavailable" error when attempting to render in the IE7 browser. The Application event log shows:
Failed to initialize the AppDomain:/LM/w3svc/1/ROOT/CIRTWFE
Message: Could not load file or assembly 'System.Web, Version=18.104.22.168, 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.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)
The System.Web file is in the \windows\assembly folder. The \windows\microsoft.net\framework\v2.0.50727 folder has the ASPNET worker processor account with the proper permissions. And yet I continue to get this error. Any thoughts on what I am missing?
Oct 27, 2009 03:58 PM|atconway|LINK
1st, take a look to the following link with a similar exception caused by the 'NETWORK SERVICE' account permissions:
Also one thing to check; are you running your web applications through the VS.NET Development Server or IIS? I have seen an error similarly displayed when the site is ran through IIS and the website has not been configured to use ASP.NET 2.0, but rather
is using the default of ASP.NET 1.1.
Oct 27, 2009 04:04 PM|kaw296|LINK
Iam running the sites in IIS on my local machine. Both are configured for ASP.NET 2.0.50727.
Oct 27, 2009 04:19 PM|atconway|LINK
Did you work through the solutions in the link I provided? It seems the error you are getting is quite common, and I found several links diagnosing the problem.
Also, try running from the development server (right-click project, goto properties, select the 'Web' tab' and choose the radio button for 'Use Visual Studio Development Server') just to see if it works, or if you get the same issue.
Oct 29, 2009 10:53 AM|kaw296|LINK
Pls forgive my delayed reply. I had to get some production work done and now am back. I have some time today to devote to this.
I ran the app using the dev server as suggested. It does work, though it failed to connect to the newly constituted database, but that's another issue. Bottom line is that the app started and code was executed.
I went thru the solutions noted, but nothing worked. Same problem each time. I've compared folder security between my old laptop (all web apps work) and my new laptop (no web apps work) and cannot find anything. The ASPNET & NETWORK SERVICE accts are set
up on \WINDOWS\Microsoft.NET\Framework\v2.0.50727 folders. I also verified that the System.Web.dll file is in the \WINDOWS\assembly folder with the 22.214.171.124 version and same key.
All my newly loaded/configured web apps (all .NET 2.0) throw the same error. I'm truely stumped here.
Oct 29, 2009 11:24 AM|atconway|LINK
Since it worked on the dev server and not on IIS, we definently know this is isolated to an IIS configuration issue specifically in regards to the NETWORK SERVICE or ASPNET user permissions. One of the folders somewhere is still missing access which is odd.
Did you make sure that you applied the proper permissions to both the 'wwwroot' folder and on the actual IIS virtual directory you are using to run your site?
Read this from the following link:
The Network Service account has Read and Execute permissions on the IIS server root folder by default. The IIS server root folder is named Wwwroot. This means that an ASP.NET application deployed inside the root folder already has Read and Execute permissions
to its application folders. However, if your ASP.NET application needs to use files or folders in other locations, you must specifically enable access.
Here is another link where someone was stuck as well:
Lastly, the IIS forum may have some insight as well as to pinpointing which directory you are missing the proper permissions. That NETWORK SERVICE (Windows Server) and ASPNET (Windows) accounts need permissions on more than just the ASPNET Framework folder
you mentioned prior. Here is a link to the IIS forum as well:
IMO, this was one of the best things that Microsoft incorporated the integrated Development Server into VS.NET 2005+. It was always a real pain getting IIS configured properly for
all of the projects on the development machine. I almost never set my projects up on IIS on my development machine now, and rather use the development server in VS.NET. I only have to set up IIS on either my test or productions servers, which are
stable and do not have issues like this. Might be a good time to switch over to the dev server to ease configuration if you can.
Oct 31, 2009 08:18 AM|mathew7535|LINK
Check out below given link, will be helpful
.NET Runtime 2.0 Error
configuration asp.net 2.0
asp .net 2.0
Asp .net 2.0 with C#
ASP.NET 2.0 C#
Jan 19, 2010 10:27 AM|kaw296|LINK
First let me apologize for not replying to the outcome of your suggestions sooner.
The problem was not related to .NET, IIS or VS. My newly issued laptop was not keeping up with patches, though it was automatically programmed to do so. Once the patches were up to date my .NET problem resolved itself. All my web apps are working as designed.
Thank you again for all the suggestions. I certainly learned a lot about .NET in the process.