English 中文(简体)
如何将.Net 6.0的dll引用到.Net Framework 4.8中
原标题:How to reference .Net 6.0 dll in .Net Framework 4.8

Good day Everyone! I have a Class Library project which targets .Net framework 6.0. When I reference this dll into another project which targets .Net framework 4.8, I get the following error message

“entergraph

我将感激你的帮助。 (wǒ jiāng gǎn jī nǐ de bāng zhù.)

问题回答

简短的回答是"你不能"。.NET 6和.Net Framework 4.8是完全不同的实体,彼此之间不兼容。

如果你想要一个能够运作的图书馆。 NET Framework and NET, You lloshi to look into 。 NET 标准,具体版本2.0。 它不是所有的东西,而是可以从“NET Framework”和“NET 5/6”(以及较早的“核心”版本)中参考。

尽管如此,如果你能够更新申请,情况会更好。 NET 6. 结 论 WinForms(从您的屏幕上看,你喜欢再次使用)在“网络6”中得到了支持,因此,作出这一改变应当非常简单。

Answer:

.NET Framework 4.8与.NET版本不兼容的一个主要原因是,不同版本的.NET和.NET Framework使用一个运行时。运行时是所有代码的执行环境。例如,.NET Framework 4.8应用程序使用.NET Framework 4.8运行时,但.NET 6 dll需要.NET 6运行时。

Reference:

将此翻译为中文:https://learn.microsoft.com/en-us/dotnet/core/versions/selection https://learn.microsoft.com/en-us/dotnet/core/versions/selection

例如,.NET 5 SDK 包括 .NET 5 运行时...

.NET 6和.Net Framework 4.8是不同的。它们彼此不兼容。如果您想要升级,可以参考以下文件。

使用.NET升级助手将WPF应用程序升级到.NET 6。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签