[英]MVC 6: System.IO.FileNotFoundException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource
I got this error in my staging environment but don't get it in my local environment. 我在暂存环境中遇到此错误,但在本地环境中无法获取此错误。 The staging server is Windows Server 2008 R2.
登台服务器是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 staging environment was working at one point and this error is recent. 暂存环境一度正在运行,此错误是最近发生的。 I get this error from the error log.
我从错误日志中收到此错误。 The site just spins and does not display anything.
该网站只是旋转,不显示任何内容。
Both environments have the same dnx version 两种环境都具有相同的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
The solution is using dnx-clr-win-x86.1.0.0-rc1-update2. 解决方案是使用dnx-clr-win-x86.1.0.0-rc1-update2。
I added the package 'System.Diagnostics.DiagnosticSource' to all projects in the solution and deployed it. 我将包“System.Diagnostics.DiagnosticSource”添加到解决方案中的所有项目并进行部署。 That did nothing.
那什么都没做。
I grabbed the System.Diagnostics.DiagnosticSource.dll from the packages directory and dropped it into 'runtimes\\dnx-clr-win-x86.1.0.0-rc1-update2\\bin' directory. 我从packages目录中获取System.Diagnostics.DiagnosticSource.dll并将其放入'runtimes \\ dnx-clr-win-x86.1.0.0-rc1-update2 \\ bin'目录。 I then get an error this error
然后我得到一个错误这个错误
Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.1.0
I placed the System.Numerics.Vectors.dll into the bin directory like I did with the DiagnosticSource.dll but I still get the missing Vectors.dll error. 我将System.Numerics.Vectors.dll放入bin目录,就像我使用DiagnosticSource.dll一样,但我仍然得到了丢失的Vectors.dll错误。 I don't believe I should be placing DLLs into the runtime bin directory.
我不相信我应该将DLL放入运行时bin目录。 How do I solve this?
我该如何解决这个问题?
Update 更新
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
Looks like you have not .Net Framework 4 installed. 看起来你没有安装.Net Framework 4。 Normally the assembly like System.Numerics.Vectors should be loaded from GAC not from local bin directory.
通常,应该从GAC加载像System.Numerics.Vectors这样的程序集,而不是从本地bin目录加载。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.