Referrencing .NET 6 assembly package in a .NET Framework 4.8 assembly

Wonderful World 21 Reputation points
2022-04-22T02:48:42.287+00:00

I have a .NET 6 assembly which is uploaded to nuget as a package, and another .NET Framework 4.8 assembly.

Can the .NET 6 assembly package be referenced in the .NET Framework 4.8 assembly, and can it run without generating any exceptions?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,638 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,640 questions
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 29,446 Reputation points Microsoft Vendor
    2022-04-22T07:35:58.657+00:00

    Hi @Wonderful World ,

    Welcome to Microsoft Q&A forum.

    It will not work, but directly reference the .NET 6 assembly may work(instead of installing and referencing the NuGet package). Note, even if directly referencing the assembly works, it may also cause errors during developing and building.

    Best Regards,
    Tianyu

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    0 comments No comments

0 additional answers

Sort by: Most helpful