Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
652 views
in Technique[技术] by (71.8m points)

c# - How to Fix, Could not load file or assembly 'XXX' or one of its dependencies. Strong name signature could not be verified

Currently I have the source of System.Web.Mvc assembly. Building is fine. But at runtime it throws,

Could not load file or assembly 'System.Web.Mvc' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)

How can I debug it? I am using windows 7.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It seems that you are trying to debug the ASP.NET MVC source code and have built your own version of the System.Web.Mvc assembly. The problem with this approach is that you cannot sign it with the official keys. This means that any third party component that you might be using and which depends on System.Web.Mvc should also be recompiled against your own version. Take for example Razor. It also depends on System.Web.Mvc. Did you recompile that as well?

Personally I find it extremely difficult to be building your own version of System.Web.Mvc. In practice I debug the source code by using the publicly available PDB symbols. So I would advice you NOT to be compiling your own version but work with the official one. Take a look at this post: https://stackoverflow.com/a/13610108/29407


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...