简体   繁体   English

.NET WinForms:无法加载 System.Runtime

[英].NET WinForms: Cound not load System.Runtime

I was writing an app for a friend who wanted an easy way to use Morse Code.我正在为一个想要简单地使用摩尔斯电码的朋友编写一个应用程序。

I was attempting to use an External Library that I wrote with Morse Code support, and when I try to call it, I get this error, in an External " Control.cs " file.我试图使用我在摩尔斯电码支持下编写的外部库,当我尝试调用它时,我在外部“ Control.cs ”文件中收到此错误。 I found happened in both Visual Studio and JB Rider, though Visual Studio gives a different error as it can't debug external sources.我发现在 Visual Studio 和 JB Rider 中都发生了这种情况,尽管 Visual Studio 给出了不同的错误,因为它无法调试外部源。

My usings are:我的用途是:

using CainsSharpTools; // <= This is my Library
using System.Diagnostics;
using System.Windows.Forms;

And my function call looks like this:我的 function 调用如下所示:

private void buttonEncode_Click(object sender, System.EventArgs e)
            => textBoxMorse.Text = MorseCode.Parse(textBoxPlain.Text).Value;

The error is错误是

System.IO.FileLoadException: Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
  at at MorseCoder.Form1.buttonEncode_Click(Object sender, EventArgs e)
  at at System.Windows.Forms.Control.OnClick(EventArgs e)
  at at System.Windows.Forms.Button.OnClick(EventArgs e)
  at at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
  at at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
  at at System.Windows.Forms.Control.WndProc(Message& m)
  at at System.Windows.Forms.ButtonBase.WndProc(Message& m)
  at at System.Windows.Forms.Button.WndProc(Message& m)
  at at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  at at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  at at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  at at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
  at at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
  at at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
  at at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
  at at System.Windows.Forms.Application.Run(Form mainForm)
  at MorseCoder.Program.Main() in C:\Users\caina\source\repos\MorseCoder\MorseCoder\Program.cs:19

i needed to use .NET Standard with my Lib我需要在我的 Lib 中使用 .NET Standard

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C# .NET“无法加载文件或程序集 System.Runtime” - C# .NET "Could not load file or assembly System.Runtime" 无法使用.Net Core dll加载文件或程序集&#39;System.Runtime&#39; - Could not load file or assembly 'System.Runtime' with .Net Core dll 无法加载文件或程序集System.Runtime - Cannot load file or assembly System.Runtime .NET Framework:如何更新 System.Runtime? - .NET Framework: How to update System.Runtime? 无法在.NET Core中加载文件或程序集“System.Runtime,Version = 4.1.0.0” - Could not load file or assembly 'System.Runtime, Version=4.1.0.0' in .NET Core Dynamics NAV 2017 .NET 互操作:发生异常,'无法加载文件或程序集'System.Runtime,版本 = 5.0.0.0 - Dynamics NAV 2017 .NET interop: exception occurred, 'Could not load file or assembly 'System.Runtime, Version=5.0.0.0 无法调试 .NET Core:无法加载文件或程序集“System.Runtime,版本 = 4.2.1.0 / 4.2.0.0 - Can't debug .NET Core: Could not load file or assembly 'System.Runtime, Version=4.2.1.0 / 4.2.0.0 .NET Core 3.1 - 无法加载文件或程序集 System.Runtime,版本 = 4.2.2.0 - .NET Core 3.1 - Could not load file or assembly System.Runtime, Version=4.2.2.0 无法在Visual Studio WebApi项目上加载System.runtime dll - Failure to load System.runtime dll on Visual studio WebApi project Moq:FileNotFoundException:无法加载文件或程序集&#39;System.Runtime&#39; - Moq : FileNotFoundException: Could not load file or assembly 'System.Runtime'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM