I have a strange error. I created for testing purposes a normal Console Application and run my own Tracer which is written with the help of Mono.Cecil on this application. I embedd a Stopwatch at the entry and exit of every method.

After I embedd it (the IL doesn't have any errors or warnings in it, when I inspect it with ILSpy) and try to run the Console Application it throws:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime .Extensions, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its depende ncies. The system cannot find the file specified.

Which is really strange, because Version = doesn't even exists? Does anybody have a idea how this could be solved?

So when I try to give that Application any other Version of System.Runtime.Extensions this is thrown:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.Ext ensions, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencie s. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I'm stuck and would be thankful for every help or idea to resolve this problem.

  • this looks very similar - stackoverflow.com/questions/10878602/… – R4444 Jun 8 at 4:11
  • Is your problem with the non-existing version or the reference itself? System.Diagnostics.StopWatch resides in System.Runtime.Extensions for .net core so I guess it makes sense that the app tries to load it. – Paweł Łukasik Jun 8 at 18:37
  • The main problem is the version it asks, because version= doesn't even exists. I have no idea why it would ask me for this kind of version. I could solve it a little bit with Mono.Cecil, by loading System.Runtime.Extensions and change the Version to ''. But I think it is not a good idea to do it this way. – programming_is_bae Jun 8 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.