Need info on .net core and .net framework

MM, Sunil 86 Reputation points
2021-12-03T14:27:28.84+00:00

Hi Team,

I have a current project which is built on .net framework 4.7 and now i want to convert that projects to .net core.
Could you please guide me which .net framework i need to install to convert my .net framwork 4.7 project to .net core?.

  1. .Net core 3.1 is latest? -- should we use this.?
  2. .Net 5 is latest? .Net 5 is framework + core right?

Regards,
Sunil

Developer technologies .NET .NET Runtime
Developer technologies C#
{count} votes

4 answers

Sort by: Most helpful
  1. Rijwan Ansari 766 Reputation points MVP
    2022-02-05T14:15:26.39+00:00

    Hi @MM, Sunil ,

    It is obviously a wise decision to migrate into .NET core for several reasons check here, however it is not straight forward.

    Regarding your questions:

    • .NET 6 is the latest version and is only in core. Going forward, after .NET 5, there won't be .NET framework releases. ( .NET framework 4.8 is the last version).
    • I would suggest choosing .NET 6 because it would easy to upgrade into next upcoming versions, and also there are numerous advantages.

    To start, you need to create a new solution into .NET 6 core and rewrite the code, but most of those code can be reused depending on dependencies.
    Also check
    https://learn.microsoft.com/en-us/dotnet/core/porting/
    https://learn.microsoft.com/en-us/dotnet/core/compatibility/fx-core

    1 person found this answer helpful.

  2. Castorix31 90,521 Reputation points
    2021-12-03T14:41:29.687+00:00

    .NET Core != .NET Framework

    Last version is 6 (for VS 2022) : Download .NET 6.0

    and : Overview of porting from .NET Framework to .NET


  3. Karen Payne MVP 35,586 Reputation points Volunteer Moderator
    2021-12-03T16:25:18.617+00:00

    For VS2019 use .NET Core 5 as .NET Core 6 is for VS2022.

    In regards to converting from Framework 4.7, there is not a straight conversion as somethings are not available in .NET Core at all or need NuGet packages. For example there is no BindingNavigator, if working with SQL-Server in 4.7 the reference is already included while in .NET Core 5 you need to install a NuGet package. Other things such as Process.Start need different parameters in some cases.

    It takes a little time to get the hang of things but once you do it becomes easier.

    See also Overview of porting from .NET Framework to .NET


  4. Xingyu Zhao-MSFT 5,381 Reputation points
    2021-12-09T08:30:27.923+00:00

    Hi @MM, Sunil ,

    a project1.dll cannot be referenced because it uses built-in support for WinRT

    As suggested in the this document : Previous versions of .NET Framework and .NET Core had built-in knowledge of WinRT, a Windows-specific technology. To support the portability and efficiency goals of .NET 5, we lifted the WinRT projection support out of the .NET compiler and runtime and moved it into the C#/WinRT toolkit.

    b Targeting .NET 6.0 in Visual Studio 2019 is not supported

    In order to use .NET6, you need to install Visual Studio 2022.
    In this case, you can target .NET5 when using Visual Studio 2019.

    c Could not locate the assembly "System.Runtime.Remoting"

    Check: .NET Framework technologies unavailable on .NET Core and .NET 5+ - Several technologies available to .NET Framework libraries aren't available for use with .NET 5+ (and .NET Core), such as app domains, remoting, and code access security (CAS). If your libraries rely on one or more of the technologies listed on this page, consider the alternative approaches mentioned.
    Take a look at : I need an alternative similar to System.Runtime.Remoting that is supported in .NET 5.0

    Hope them could be helpful.

    Best Regards,
    Xingyu Zhao
    *
    If the answer is helpful, please click "Accept Answer" and upvote it.
    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.