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=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its depende ncies. The system cannot find the file specified.
Which is really strange, because Version = 4.2.2.0 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=4.2.2.0, 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.
System.Diagnostics.StopWatch
resides inSystem.Runtime.Extensions
for .net core so I guess it makes sense that the app tries to load it.