TypeLoadException was unhandled in C#

前端 未结 2 932
广开言路
广开言路 2021-01-04 08:44

I\'m fairly new to C#, and am having a problem when loading a library into my program. Im trying to run this example in visual studio, but I am getting an error:

<         


        
2条回答
  •  时光说笑
    2021-01-04 09:00

    I wanted to add this as a comment (but not high enough rep yet) - I had this exact issue and found @JonSkeet answer really useful, between myself and a colleague we stumbled on the answer;

    https://stackoverflow.com/a/13236893/692942.

    Basically my project assembly which generated an EXE file was named the same as a referenced assembly I built as a class library. The combination of the EXE and DLL in the build directory cause the error to be thrown as only one assembly of that name could be loaded.

提交回复
热议问题