Question Migrating from .NET Framework to .NET Core

mauede

Well-known member
Joined
Sep 1, 2021
Messages
103
Location
Northwood - UK
Programming Experience
Beginner
I have written only 216 lines of C# code for my new project.
I would like to migrate from .NET Framework 4.8 to .NET Core 6.0
How can I do that?

Thank you in advance.
Maura
 
Last edited by a moderator:
The link to consolex github?
 
The image in post 3, you need to remove the COM reference "system_windows_forms"
 
I downloaded ConsoleX from Rex Cardan GitHub account. I added the 3 C# files to my project, added a "using ConsoleX" in my file and built the solution
 
Here's what I would do:
1 create a new Console Application (.Net 6)
2 edit project file for the below
XML:
<TargetFramework>net6.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
3 save and rebuild
4 add the three .cs files from ConsoleX, and rebuild
5 add any custom code you had from the old .Net 4.8 project.
 
Here's what I would do:
1 create a new Console Application (.Net 6)
2 edit project file for the below
XML:
<TargetFramework>net6.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
3 save and rebuild
4 add the three .cs files from ConsoleX, and rebuild
5 add any custom code you had from the old .Net 4.8 project.
Will try tomorrow. Thank you so much
 
Will try tomorrow. Thank you so much
The procedure you indicated works. Thank you so much.

By chance, I would like to know how to edit the project file to generate a self-contained executable. At present, when I publish my code Visual Studio creates an executable but it dumps in the same folder all the files the executable depends on.
My goal is to create an app that includes the .exe and the runtime environment. So that app could be installed in any other Windows platform.
Thank you
 
Right-click project in Solution Explorer and select Publish. After creating profile for example to output to folder, edit Target Runtime in profile settings from 'portable' to for example 'win-x64' and in File publish options check 'Produce single file'. You can choose Deployment mode framework-dependent (target system has .Net) or self-contained (includes any .Net libraries used).
 

Latest posts

Back
Top Bottom