无法加载文件或程序集 HRESULT:0x80131515(将控制器添加到在网络驱动器上具有程序集引用的 MVC 项目时) [英] Could not load file or assembly HRESULT: 0x80131515 (When adding controller to MVC project that has assembly references on network drive)

查看:42
本文介绍了无法加载文件或程序集 HRESULT:0x80131515(将控制器添加到在网络驱动器上具有程序集引用的 MVC 项目时)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过这个:VSTS 2010 SGEN :错误:无法加载文件或程序集(来自 HRESULT 的异常:0x80131515) 并且所有答案均无效.当我构建或任何东西时它也不会出现.我可以正常运行项目,当我尝试添加实体框架模板控制器时会发生这种情况:

然后我得到这个错误:

所有项目文件都在我的网络共享上,因为那是我们工作的我的文档"所在的位置.这是我尝试过的:

1) 将项目设置中的 Generator Serialization Assembly 设为打开、关闭和自动.

2) 使用以下代码将 sgen.exe.config 添加到 C:Program FilesMicrosoft SDKsWindowsv7.0AinNETFX 4.0 Tools:

<预><代码><配置><运行时><loadFromRemoteSources enabled="true"/></运行时></配置>

3) 尝试取消阻止程序集,但我在属性选项卡中没有取消阻止选项.

这些解决方案都不起作用.有谁知道我该如何解决这个问题???由于 nuget 或我自己的项目的位置存在于网络空间中,因此任何来自 nuget 或我自己的项目的自定义程序集都会发生此错误,但仅在尝试添加 EF 模板化控制器时才会发生.我可以很好地构建和运行程序.

解决方案

尝试将您的 <loadFromRemoteSources enabled="true"/> 添加到 C:[Visual Studio 2010 InstallDir]Common7IDEdevenv.exe.config 直接位于 下方,看看是否有帮助 :)

I've seen this: VSTS 2010 SGEN : error : Could not load file or assembly (Exception from HRESULT: 0x80131515) and none of the answers work. It also doesn't appear when I build or anything. I can run the project fine, it happens when I try to add an entity framework templated controller:

Then I get this error:

All project files are on my network share because that is where My Documents resides for our work. Here is what I tried:

1) Turning Generator Serialization Assembly in project settings to on, off, and auto.

2) Adding sgen.exe.config to C:Program FilesMicrosoft SDKsWindowsv7.0AinNETFX 4.0 Tools with the following code:

<configuration>
 <runtime>
   <loadFromRemoteSources enabled="true" />
 </runtime>
</configuration>

3) Tried to unblock the assemblies, but I had no unblock option in the properties tab.

None of these solutions work. Does anyone have any idea how I can fix this??? This error occurs for any custom assembly from nuget or my own projects due to their location existing on the network space, but only when trying to add an EF templated controller. I can build and run the program fine.

解决方案

Try adding your <loadFromRemoteSources enabled="true" /> to C:[Visual Studio 2010 Install Dir]Common7IDEdevenv.exe.config directly below <runtime> and see if that helps :)

这篇关于无法加载文件或程序集 HRESULT:0x80131515(将控制器添加到在网络驱动器上具有程序集引用的 MVC 项目时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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