VSTS 2010 SGEN:错误:无法加载文件或程序集(HRESULT 异常:0x80131515) [英] VSTS 2010 SGEN : error : Could not load file or assembly (Exception from HRESULT: 0x80131515)

查看:28
本文介绍了VSTS 2010 SGEN:错误:无法加载文件或程序集(HRESULT 异常:0x80131515)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 VS2010 时遇到了一个奇怪的问题.我们使用 TFS 来构建我们的 API dll,并且我们过去常常在我们的项目中引用它们,使用完全信任的映射网络驱动器.我们已经这样工作了至少两年,一切都很完美.

I am experiencing a strange issue with VS2010. We use TFS to build our API dlls and we used to reference them in our projects usign a mapped network drive that was fully trusted. We have been working like that for at least two years and everything worked perfectly.

今天,我将一个 webapp 转换为 vs2010,当我在 Release 中编译它时,它给了我:

Today, I converted a webapp to vs2010 and when I compile it in Release, it's giving me:

SGEN:错误:无法加载文件或程序集 'file:///L:ApiReleaseAPI_20100521.1ReleaseCS.API.Exceptions.dll' 或其依赖项之一.手术不支持.(例外来自HRESULT: 0x80131515)

SGEN : error : Could not load file or assembly 'file:///L:ApiRelease API_20100521.1ReleaseCS.API.Exceptions.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

奇怪的是它在 Debug 配置文件下工作...

The strange thing is that it's working when it's under the Debug profile...

我尝试添加

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

进入 app.config 仍然没有运气(请参阅 http://social.msdn.microsoft.com/Forums/en/msbuild/thread/d12f6301-85bf-4b9e-8e34-a06398a60df0http://msdn.microsoft.com/en-us/library/dd409252(VS.100).aspx)

into app.config and still no luck (See http://social.msdn.microsoft.com/Forums/en/msbuild/thread/d12f6301-85bf-4b9e-8e34-a06398a60df0 and http://msdn.microsoft.com/en-us/library/dd409252(VS.100).aspx)

我很确定这个问题来自 Visual Studio 或 msbuild,因为我们的代码在 prod 中不会从网络共享运行,因为所有引用的 dll 都被复制到 bin 文件夹中.

I am pretty sure that this issue is from visual studio or msbuild, as our code won't run from a network share when in prod because all the referenced dll's are copied into the bin folder.

如果有人有解决方案(或只是搜索路径的想法),请告诉我!

If anyone has an solution (or just an idea for a search path) please let me know !

事实证明它在调试模式下工作,因为序列化程序集的生成已关闭.正如标题所说,这确实是一个 SGEN 问题,因为正是这个实用程序说该路径不受信任......

Edit : It turns out that it was working in Debug mode because generation of serialisation assemblies was turned Off. As the title say, it's really a SGEN problem since it is this utility that says that the path is not trusted...

推荐答案

我能够通过在 Windows 资源管理器中找到程序集 DLL,右键单击,选择属性",然后按取消阻止"按钮来修复此错误.DLL 有一个将其标记为外部文件的流 - 通过单击取消阻止,您可以删除该名称.

I was able to fix this error by finding the assembly DLL in Windows Explorer, right clicking, choosing Properties, and then pressing the "unblock" button. The DLL has a stream that is marking it as an external file - and by clicking unblock you remove that designation.

这篇关于VSTS 2010 SGEN:错误:无法加载文件或程序集(HRESULT 异常:0x80131515)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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