简体   繁体   English

MVC 6:System.IO.FileNotFoundException:无法加载文件或程序集'System.Diagnostics.DiagnosticSource

[英]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.

相关问题 VS2015:XAML设计器:错误:“ System.IO.FileNotFoundException系统找不到指定的文件。 (HRESULT的例外:0x80070002” - VS2015: XAML Designer: Error: “System.IO.FileNotFoundException The system cannot find the file specified. (Exception from HRESULT: 0x80070002” 抛出异常:mscorlib.dll C3 Discord.NET bot 中的“System.IO.FileNotFoundException” - Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll C3 Discord.NET bot 无法加载文件或程序集“System.Spatial”或其依赖项之一 - Could not load file or assembly 'System.Spatial' or one of its dependencies Visual Studio“ FileNotFoundException:无法加载程序集”问题,但没有文件名? - Visual Studio “FileNotFoundException : Could not load assembly” issue, but without file name? 通用Windows平台和SignalR(无法加载文件或程序集'System.Net,版本= 2.0.5.0) - Universal Windows Platform and SignalR (Could not load file or assembly 'System.Net, Version=2.0.5.0) MSCHART:无法加载文件或程序集'System.Windows.Forms.DataVisualization-vs2015-Winform - mschart: Could not load file or assembly 'System.Windows.Forms.DataVisualization - vs2015 - winform 无法加载文件或程序集“System.Memory,版本=4.0.1。” 在 Visual Studio 2015 中 - Could not load file or assembly 'System.Memory, Version=4.0.1.' in Visual Studio 2015 无法加载文件或程序集“ PayPalCoreSDK” - Could not load file or assembly 'PayPalCoreSDK' VisualStudio无法加载文件或程序集 - VisualStudio Could not load file or assembly 无法加载文件或程序集“System.Net.Http,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a” - Could not load file or assembly "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM