.NET 2.0 Error


I have created a webservice at the location //localhost/WebSite using VS 2005 Beta 2. The webservice contains nothing but the helloWorld web method. When I run a debug I get a server unavailable error in IE and the following in the event viewer:
Warning:
Failed to initialize the AppDomain:/LM/w3svc/1/ROOT/WebSite
Exception: System.Web.Hosting.HostingEnvironmentException
Message: Failed to access IIS metabase.
Error:
Failed to execute request because the App-Domain could not be created.
Error: 0x80131500
Does anyone have any idea why this is happening or how I can fix it? If more information is needed please let me know.
Thanks in advance,
Lumstar
[1109 byte] By [lumstar] at [2008-3-3]
# 1
I'm getting the same error and warning. I've tried doing aspnet_regiis -u then -i (which mucks up a multiple framework environment, btw) and various other things, like giving user aspnet full permissions to the MetaBase.bin file (along with large swaths of other places). Those were fixes that I have seen elsewhere. Nothing is working so far.
PhillipTH at 2007-9-9 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...
# 2
A problem could be the Temporary ASP.NET file on your local workstation, in %SystemRoot%\Microsoft.NET\Framework\v2.0.50215\Temporary ASP.NET Files, could be in an inconsistent state.

In this directory, you should see a directory for each ASP.NET web application. For example, if you vdir was named Bob, you could go http://localhost/bob, you should see a Bob directory in the Temporary ASP.NET Files directory. Remove the bob directory in Temporary ASP.NET files and recompile.

AndyWahrenbergerMSFT at 2007-9-9 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...
# 3
I tried deleting the temporary files that Andy mentioned, but it didn't fix it.
For the moment, I have things going again having changed the C:\WINNT\Microsoft.NET\Framework\v2.0.50215\CONFIG\machine.config file's processModel tag.
From:
<processModel autoConfig="true"/>
To:
<processModel userName="system" password="AutoGenerate" />
PhillipTH at 2007-9-9 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...
# 4
Forgive me for jumping in here. I hope I don't take this thread a stray.

I am having the same issue as noted above, but when I go to the folder for the Temporary ASP.NET Files, I don't see a folder for my virtual directory application.

My event log error leads me to believe my server is locked down too tight and I need to give some access to something. Here is my app log error:

Failed to initialize the AppDomain:/LM/W3SVC/1918777365/Root/BlogUpdates

Exception: System.IO.FileLoadException
Message: Access is denied: 'System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
StackTrace: at System.AppDomain.CreateInstance(String assemblyName, String typeName)
at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentFlags hostingFlags)
at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(String appId, IApplicationHost appHost, HostingEnvironmentFlags hostingFlags)

InnerException: System.UnauthorizedAccessException
Message: Access is denied.
StackTrace:

MADCookie at 2007-9-9 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...
# 5

Which Windows platform are you using?

It sounds like you are using the ASP.NET process model and the user account on the worker process does not have read access to the metabase.

Most probably the user account simply needs to be added to the IIS_WPG user group.

Changing it to run as SYSTEM is not secure and is not recommended.

Daniel Roth

DanielRoth at 2007-9-9 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...
# 6
The machine is running Windows 2000, and IIS is version 5.
I think that the IIS_WPG user changes you mentioned, Daniel, only apply to IIS 6, right?
I know running it as SYSTEM is bad. I don't intend to use this cludge if an accessable server ever develops the same error. But when one or more of them are changed in the same way that this dev-box has been, and they then develop the error, I'll need a fix ready.
PhillipTH at 2007-9-9 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...
# 7
Yes, you are correct.

For your platform the worker process needs to be able to read the metabase for Whidbey. I believe aspnet_regiis is supposed to add access for the ASPNET account to the metabase on install. Re-running aspnet_regiis -ir should in theory fix it. I believe aspnet_regiis /ga for the account should also do it.

Daniel Roth

DanielRoth at 2007-9-9 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...
# 8

I've now gone from seeing/fixing the problem once with the description above to seeing it a second time. As was posted earlier, clearing the Temporary ASP.NET files didn't fix it.

But also as described above, running the aspnet_regiis command from the 2.0 Framework directory did solve it for the second instance.

AndyWahrenbergerMSFT at 2007-9-9 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...
# 9
Please also not that <processModel autoConfig=”true” /> has nothing to do with the identity of the ASP.NET worker processes, and should be left in the configuration. It configures a number of internal system settings to improve performance.

Daniel Roth

DanielRoth at 2007-9-9 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...
# 10
I tried the "aspnet_regiis -ir" some time back and that didn't work. At the time I didn't notice the "-ga" option, but I've tried it now and it doesn't work either. It runs and says that it has given the ASPNET user permissions on the metabase. But after running it, when I look at the permissions on the MetaBase.bin file, ASPNET is not there. When I change the permissions for that file myself, the Net 2 framework sites still don't run neither with nor without a restart of IIS.
To make matters worse, whenever I restart IIS, the permissions for MetaBase.bin and other IIS files get reverted, and I don't know what is doing that. (Inheriting the admin role for a server which was setup years ago by someone who has since forgotten everything about it is such fun.)
Thanks, Daniel, for the note about the autoConfig setting. I've put that setting back, along with the userName workaround.
PhillipTH at 2007-9-9 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...
# 11
I was getting this error on Win Server 2003 and ASP.NET 2.0 Beta 2.

It turns out that IIS failed to initialize the AppDomain because my application is on a virtual root that points to a folder outside of inetpub. Once I added IIS_WPG to that outside folder, IIS was happy.

DisplayNameNot at 2007-9-9 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...
# 12
Phillip,

I hope that over the past few days you have found the answer to this issue as I have been searching for the answer today as well. We are also running under Windows 2000 with IIS 5.0 and are having no luck on getting an AppDomain to be created without putting the ASPNET user as an Administrator for the machine. Luckily it is currently on an intranet testing site.

None of the above patches seem to work. Any help from anyone on getting the metabase to have the proper permissions in this environment would be greatly appreciated. Unfortuately from my search this forum post/thread seems to be the only one out there that is trying to address this directly.

TIA,
Mark

MarkLayne at 2007-9-9 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...
# 13
Try changing directory to the 2.0 folder C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215> and run aspnet_regiis -ir

that should do the trick

LizardMan at 2007-9-9 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...
# 14
I have XP SP2 and VS2005 Beta 2.0 on my laptop. I fixed that "Failed to initialize the AppDomain:/LM/W3SVC/1/Root/xxxxxx" problem by adding ASPNET account to the Administrators group.

IgorTur at 2007-9-9 > top of Msdn Tech,.NET Development,ASMX Web Services and XML Serialization...

.NET Development

Site Classified