MVC 6: System.IO.FileNotFoundException: Failed to load file or assembly. System.Diagnostics.DiagnosticSource

I got this error in my staging environment but am not getting it in my local environment. The staging server is Windows Server 2008 R2.

System.IO.FileNotFoundException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. 

The middleware worked at one point, and this error was the last. I get this error from the error log. The site just rotates and does not display anything.

Both environments have the same dnx version.

 C:\Users\Me>dnx --version Microsoft .NET Execution environment Version: 1.0.0-rc1-16609 Type: Clr Architecture: x86 OS Name: Windows OS Version: 6.1 Runtime Id: win7-x86 

The solution uses dnx-clr-win-x86.1.0.0-rc1-update2.

I added the package "System.Diagnostics.DiagnosticSource" to all the projects in the solution and deployed it. It did nothing.

I grabbed System.Diagnostics.DiagnosticSource.dll from the package directory and put it in the runtimes \ dnx-clr-win-x86.1.0.0-rc1-update2 \ bin directory. Then i get an error

 Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.1.0 

I put System.Numerics.Vectors.dll in the bin directory, as I did with DiagnosticSource.dll, but I still get the missing Vectors.dll error. I do not believe that I should place DLLs in the bin runtime directory. How to solve this?

Refresh

 Active Version Runtime Architecture OperatingSystem Alias ------ ------- ------- ------------ --------------- ----- 1.0.0-beta8 clr x86 win 1.0.0-beta8 coreclr x86 win 1.0.0-rc1-final clr x64 win 1.0.0-rc1-final clr x86 win 1.0.0-rc1-final coreclr x64 win 1.0.0-rc1-final coreclr x86 win 1.0.0-rc1-update1 clr x64 win 1.0.0-rc1-update1 clr x86 win 1.0.0-rc1-update1 coreclr x64 win 1.0.0-rc1-update1 coreclr x86 win *1.0.0-rc1-update2 clr x86 win default 
+5
source share
1 answer

It looks like you do not have .Net Framework 4. Usually, an assembly such as System.Numerics.Vectors should be loaded from the GAC not from the local bin directory.

0
source

Source: https://habr.com/ru/post/1247743/


All Articles