读书人

发布网站出错,IIS6.0 .NET4.0,该怎么处

发布时间: 2012-03-17 19:06:28 作者: rapoo

发布网站出错,IIS6.0 .NET4.0
Server Error in '/' Application.
--------------------------------------------

Could not load file or assembly 'WEBTest' or one of its dependencies. 拒绝访问。
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'WEBTest' or one of its dependencies. 拒绝访问。

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'WEBTest' could not be loaded.


=== Pre-bind state information ===
LOG: User = NT AUTHORITY\NETWORK SERVICE
LOG: DisplayName = WEBTest
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: WEBTest | Domain ID: 4
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///F:/WebSites/Test/
LOG: Initial PrivatePath = F:\WebSites\Test\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: F:\WebSites\Test\web.config
LOG: Using host configuration file: \\?\c:\windows\microsoft.net\framework\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/f401e5aa/4e03d943/WEBTest.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/f401e5aa/4e03d943/WEBTest/WEBTest.DLL.
LOG: Attempting download of new URL file:///F:/WebSites/Test/bin/WEBTest.DLL.
LOG: Using application configuration file: F:\WebSites\Test\web.config
LOG: Using host configuration file: \\?\c:\windows\microsoft.net\framework\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
ERR: Failed to complete setup of assembly (hr = 0x80070005). Probing terminated.



Stack Trace:


[FileLoadException: Could not load file or assembly 'WEBTest' or one of its dependencies. 拒绝访问。]

[FileLoadException: Could not load file or assembly 'WEBTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. 拒绝访问。]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39


System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +144
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46

[ConfigurationErrorsException: Could not load file or assembly 'WEBTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. 拒绝访问。]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +618
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +209
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +94
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +332
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +591

[HttpException (0x80004005): Could not load file or assembly 'WEBTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. 拒绝访问。]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8946548
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258


---------------
上面是浏览新建的测试网站时抛出的错误,请问是啥问题?
网站是用VS2010 .NET4.0下生成的,服务是Win2003sp2已经安装了.NET4.0的框架支持,并且网站的ASP.NET的版本也已经选择了.NET4.0了

[解决办法]
检查C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/文件夹的安全性,是否有NETWORK Service帐号可修改权限

删除
C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/
下面的所有内容
停止管理工具-服务里面的indexing 服务
[解决办法]
没见过这种问题
[解决办法]
给目录设置可读可写权限。。

重启IIS
[解决办法]
孟子老师的方法你也试过了吗?
可以尝试修改C:\Windows\Temp文件夹的读写权限。
[解决办法]
没遇到过
[解决办法]
拒绝访问是权限问题,把ASP。NET用户的权限设置好了吗?
[解决办法]
重装iis试试看
[解决办法]
要设置账户是
NETWORK SERVICE

IIS_WPG
两个组

TEMP和C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/
都要设置
[解决办法]
应当是 访问权限导致的


[解决办法]
Appbase = file:///F:/WebSites/Test/
是否授受IIS用户(先开启匿名访问试试)访问权限?

报错显示你的dll文件无权限访问

读书人网 >asp.net

热点推荐