我在测试环境中遇到了这个错误,但是在本地环境中没有遇到。测试服务器是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.
暂存环境曾经可以正常工作,但现在出现了这个错误。我从错误日志中获取了这个错误信息。网站只是一直转圈,没有显示任何内容。
两个环境都使用相同的dnx版本。
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
解决方案是使用dnx-clr-win-x86.1.0.0-rc1-update2。我将“System.Diagnostics.DiagnosticSource”包添加到解决方案中的所有项目并部署了它,但这没用。我从packages目录中获取了System.Diagnostics.DiagnosticSource.dll并将其放入“runtimes\dnx-clr-win-x86.1.0.0-rc1-update2\bin”目录中。然而,出现了以下错误。
Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.1.0
我把System.Numerics.Vectors.dll放到了bin目录中,就像我把DiagnosticSource.dll放进去一样,但我仍然收到了缺少Vectors.dll的错误提示。我不认为我应该把DLL放到运行时的bin目录中。我该如何解决呢?
更新
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