解决一个asp.net部署错误

在服务器上面安装了.net framework 4.0后,在iis 6.0上面新建一个站点,部署,失败。
浏览器的错误提示为:
[code]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.[/code]

在服务器端的错误日志里面提示:
[code]Failed to execute request because the App-Domain could not be created. Error: 0x80070005 拒绝访问。[/code]
[code]Failed to initialize the AppDomain:/LM/W3SVC/1/ROOT

Exception: System.IO.FileLoadException

Message: Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. 拒绝访问。

StackTrace:    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.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.InternalCreateInstanceWithNoSecurity(String assemblyName, String typeName)
   at System.AppDomain.InternalCreateInstanceWithNoSecurity(String assemblyName, String typeName)
   at System.Activator.CreateInstance(AppDomain domain, 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)

[/code]

放狗搜索后,按照教程提示,逐一排查:
1.更改站点asp.net版本为4.0,无效;
2.重新创建一个应用程序池后,并指定该网站使用该程序池,无效;
3.站点文件夹权限,添加everyone读写权限后,解决。
再经过仔细排查,只要对站点文件夹添加network service用户的读权限即可。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注