Failed to execute request because the App-Domain could not be created. Error: 0×80131902
如果在Visual Studio中运行的好好的asp.net网页,部署到IIS后却发现无法运行,在系统日志中可以发现如下类似条目:
Exception: System.Configuration.ConfigurationErrorsException
Message: 引发类型为“System.Configuration.ConfigurationErrorsException”的异常。
StackTrace: 在 System.Web.Configuration.ErrorRuntimeConfig.ErrorConfigRecord.System.Configuration.Internal.IInternalConfigRecord.GetLkgSection(String configKey)
在 System.Web.Configuration.RuntimeConfigLKG.GetSectionObject(String sectionName)
在 System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)
在 System.Web.Configuration.RuntimeConfig.get_HostingEnvironment()
在 System.Web.Hosting.HostingEnvironment.StartMonitoringForIdleTimeout()
在 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)
在 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)
在 System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
在 System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。
Failed to execute request because the App-Domain could not be created. Error: 0×80131902
很有可能是IIS的asp.net插件在安装.net(特别是高版本)中造成了损坏,用以下方法修复:
- With a command window, get to the latest version of .net under “C:\Windows\Microsoft.Net\Framework\”
- Now run the following command: “net stop w3svc” to stop web services.
- Then use “aspnet_regiis.exe -ua” to uninstall all instances of ASP.NET from IIS.
- Follow with “aspnet_regiis.exe -i” to install ASP.NET into IIS.
- Now restart web services with “net start w3svc”.
在我的机器上修复成功。