The located assembly's manifest definition does not match the assembly reference

前端 未结 30 2124
北恋
北恋 2020-11-22 01:41

I am trying to run some unit tests in a C# Windows Forms application (Visual Studio 2005), and I get the following error:

System.IO.FileLoadException: Co

30条回答
  •  后悔当初
    2020-11-22 01:50

    The following redirects any assembly version to version 3.1.0.0. We have a script that will always update this reference in the App.config so we never have to deal with this issue again.

    Through reflection you can get the assembly publicKeyToken and generate this block from the .dll file itself.

    
     
        
        
      
    
    

    Note that without an XML namespace attribute (xmlns) this will not work.

提交回复
热议问题