admin管理员组

文章数量:1644597

System.IO.FileNotFoundException:“未能加载文件或程序集“System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。系统找不到指定的文件。”

System.IO.FileNotFoundException
  HResult=0x80070002
  Message=未能加载文件或程序集“System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。系统找不到指定的文件。
  Source=System.Memory
  StackTrace:
   在 System.ReadOnlySpan`1..ctor(T[] array)
   在 System.ReadOnlySpan`1.op_Implicit(T[] array)
   在 WindowsFormsApp1.Form1.Form1_Load(Object sender, EventArgs e) 在 C:\Users\31401\source\repos\WindowsFormsApp1\Form1.cs 中: 第 26 行
   在 System.Windows.Forms.Form.OnLoad(EventArgs e)
   在 System.Windows.Forms.Form.OnCreateControl()
   在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   在 System.Windows.Forms.Control.CreateControl()
   在 System.Windows.Forms.Control.WmShowWindow(Message& m)
   在 System.Windows.Forms.Control.WndProc(Message& m)
   在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   在 System.Windows.Forms.Form.WmShowWindow(Message& m)
   在 System.Windows.Forms.Form.WndProc(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

内部异常 1:
FileNotFoundException: 未能加载文件或程序集“System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。系统找不到指定的文件。

在Visual Studio 2019下出现这个问题解决方案:

增加引用System.Runtime.CompilerServices.Unsafe的引用,版本5.0.0.0

本文标签: unsafeVersionCompilerServicesSystemRuntime