无法加载文件或程序'System.Web程序,版本= 4.0.0.0,文化=中性“或它的一个依赖。访问被拒绝 [英] Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral' or one of its dependencies. Access is denied

查看:237
本文介绍了无法加载文件或程序'System.Web程序,版本= 4.0.0.0,文化=中性“或它的一个依赖。访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好像已经有像这些问题100S ..我经历相当多的人搜索和他们似乎并不暗示什么,我还没有尝试过。

Seems like there are already 100s of questions like these.. I have search through quite many of them and they don't seem to suggest anything that I haven't tried yet.

我得到的错误:

Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral,    PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied. 
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 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied.

Source Error: 



Line 44:         private static IKernel CreateKernel()
Line 45:         {
Line 46:             var kernel = new StandardKernel();
Line 47:             try
Line 48:             { 

以上code是在我的Ninject初始化器present。

The above code is present in my Ninject Initializer.

我已经给每个人上的权限:

C:\\ WINDOWS \\ Microsoft.NET \\框架\\ v4.0.30319

C:\Windows\Microsoft.NET\Framework\v4.0.30319

C:\\ WINDOWS \\ Microsoft.NET \\ Framework64 \\ v4.0.30319

C:\Windows\Microsoft.NET\Framework64\v4.0.30319

C:\\ Program Files文件(x86)的\\参考大会\\微软\\框架\\ .NETFramework

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\ .NETFramework

FusionLog详情:

FusionLog Details:

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files (x86)\IIS Express\iisexpress.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = System.Web, Version=4.0.0.0, Culture=neutral,    PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///F:/TFS/MMSChange/Main/SMRH.MMSChange/SMRH.MMSChange.Web/
LOG: Initial PrivatePath = F:\TFS\MMSChange\Main\SMRH.MMSChange\SMRH.MMSChange.Web\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Found application configuration file     (F:\TFS\MMSChange\Main\SMRH.MMSChange\SMRH.MMSChange.Web\web.config).

我也对我的code的文件夹给了每个人的权限。我曾尝试运行procmon中(这有助于我与以前不同的解决方案类似的问题);但它并没有创造System.Web.dll中的一个条目。

I have also given everyone permissions on my code's folders. I have tried running ProcMon (which has helped me with the similar problems for different solutions before); but it does not create a single entry for system.web.dll.

我有模拟内置的。我使用单独的帐户来访问数据库和模拟数据库帐户打破了这种。如果没有模拟应用程序运行正常。 (但没有数据,因为所有的数据库调用失败)

I have impersonation built in. I use separate accounts to access the database and that impersonation for the database account breaks this. Without impersonation the app runs fine. (But has no data because all the db calls fail)

有趣的是,虽然,如果我部署相同的code到我的本地机器,并通过IIS网站运行它:它的工作原理。但是,如果我只是从我的IDE调试它失败。

Funny thing is though, if I deploy the same code to my local machine and run it via an IIS Web Site: it works. But if I just debug it from my IDE it fails.

推荐答案

好吧,让我找到了解决办法。

Alright, so I found the solution.

多小时的调试和联系Microsoft支持,取得了什么之后。我决定从头开始。我的另一个实例的将procmon 运行,并过滤后的结果,只显示的 IISEx preSS 的结果(因为这是它给了我错误的)。

After many hours of debugging and contacting Microsoft support, which yielded nothing. I decided to start from scratch. I got another instance of ProcMon running and filtered results to show only IISExpress results (Since this is the one which is giving me error).

然后我编译和从IDE启动我的应用程序,等待错误来。我得到了错误之后,我过滤的结果的访问被拒绝的。

Then I compiled and launched my application from the IDE and waited for the error to come. After I got the error, I filtered the results by "Access Denied".

通常我筛选的结果,以寻找System.Web.dll程序,但这次我决定忽略它。

Usually I filtered the results to look for system.web.dll, but this time i decided to ignore it.

我发现,这是投掷访问的唯一文件否认的是: C:\\用户\\ 1roj1 \\文档\\ IISEx preSS \\设置\\ aspnet.config (其中1roj1是我的用户帐号)。

I found that the only file which was throwing access denied was: "C:\Users\1roj1\Documents\IISExpress\config\aspnet.config" (Where 1roj1 is my user account).

我给我的模拟用户完全访问该文件,瞧一切工作!

I gave my impersonate user full access to this file and voila everything worked!

这篇关于无法加载文件或程序'System.Web程序,版本= 4.0.0.0,文化=中性“或它的一个依赖。访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆