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

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

问题描述

VS 2010,win server 2003,.net 3.5解决方案,它们是从.net 1.1迁移而来的

VS 2010, win server 2003, .Net 3.5 solution, which were migurated from .Net 1.1

解决方案中的所有项目均已延迟签名.解决方案可以针对Debug成功构建,但是对于Release始终失败,并出现以下错误. SGEN:错误:无法加载文件或程序集'AssemblingX ,版本= 1.0.5000.0,文化=中性,PublicKeyToken = xxxxxxxx'或其依赖项之一.强名验证失败. (来自HRESULT的异常:0x8013141A)

All projects in solution are Delay signed. The soluton can be build successfully for Debug, but always failed for Release with following error. SGEN : error : Could not load file or assembly 'AssemblingX, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=xxxxxxxx' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)

AssemblingX 是我要构建的项目.该项目的所有引用的DLL都保存在本地文件夹中,并且已经签名.如果我将项目 AssemblingX 的属性更改为签名,则可以成功构建解决方案以供发布.

The AssemblingX is the project i want to build. All referenced DLLs of this project are saved at local folder, and signed already. If i change the property of project AssemblingX to sign it, then solution can be built for release successfully.

我按照但是什么都没有改变.有什么想法吗?

But nothing changed. Any ideas?

谢谢

推荐答案

此问题与强名称验证有关.在 Ildasm.exe (C:\ Program Files(x86)\ Microsoft SDKs \ Windows \ v7.0A \ bin)中打开您的 AssemblyX .注意它的PublicKeyToken,以pkt123为例.现在,以管理员模式打开VS命令提示符,然后运行sn.exe命令.如:

This problem is related to Strong Name Validation. Open your AssemblyX in Ildasm.exe(C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin). Note its PublicKeyToken, lets say pkt123 for an example. Now open VS Command prompt in administrator mode and run the sn.exe command. Such as:

sn -Vr *,pkt123

再次构建您的解决方案,到现在一切都应该没事了.

Build your solution again and everything should be fine by now.

但是,如果没有,并且您现在也收到相同的错误,则需要运行其他版本的sn.exe.要找到该位置,请转到Visual Studio命令提示符.

But if not and you receive same error now also, then you need to run a different version of sn.exe. To locate that, go to Visual Studio command prompt.

c:\Program Files(x86)>dir /s sn.exe

这可能需要5到10秒钟,并且应该提供sn.exe文件的列表.转到路径并执行必需或属于您的sn.exe,如上所示.如果不确定要执行哪一个,请执行所有sn.exe.那应该并且必须解决您的问题.如果没有,请告诉我,让我再次继承RnD.

It may take 5-10 seconds and should give a list of sn.exe files. Go to the path and execute the sn.exe, required or belongs to you, as shown above. If not sure which one to execute, execute all the sn.exe. That should and must solve your problem. If not, let me know and let me carry forward the RnD again.

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

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