Updating an existing .NET Framework project into a .NET Core one

Updating an existing .NET Framework project into a .NET Core one

Ramoon_Bandeira
Contributor Contributor
6,652 Views
25 Replies
Message 1 of 26

Updating an existing .NET Framework project into a .NET Core one

Ramoon_Bandeira
Contributor
Contributor

Now that Revit 2025 is out, Naturally, most developers will need to upgrade their existent .Net Framework Projects into .NET Core 8.0 project.

Is there a step by step guide to update an existing .NET Framework 4.8 project into a .NET core 8.0 ?
I`ve been attempting to use microsoft upgrade feature but all attempts of my part have failed miserably so far.

Thanks.

6,653 Views
25 Replies
Replies (25)
Message 21 of 26

nice3point
Advocate
Advocate

This is a NuGet restore issue: https://github.com/dotnet/project-system/issues/3164

 

If you are using Nuke, please clean obj folder before compilation

https://github.com/jeremytammik/RevitLookup/blob/dev/build/Build.Clean.cs#L14

 

And if you're using a different batch build, write more details

0 Likes
Message 22 of 26

Extraneous
Advisor
Advisor

@nice3point I use the standard Visual studio's Batch build:

Extraneous_0-1714154662994.png

 

Alexander Zuev
In BIM we trust
Facebook | Linkedin | Telegram

Message 23 of 26

retug_austin
Enthusiast
Enthusiast

I am about to go through the upgrade process myself, thank you to everyone in this thread, the information is very valuable. Do people have a preference on one vs two cs.proj's solution as @kevinaugustino mentioned (pre 2025 and  2025 and beyond)?

@kevinaugustino , Do you like your setup? I would assume that you have to maintain two code basis now, if you make an update to one cs.proj you have to do the same for the other?

 

0 Likes
Message 24 of 26

eN27
Contributor
Contributor

A separate folder is mandatory, there is no backward compatibility, net 8.0 (revit 2025) dlls can not be used with net 4.8 (revit  2024).

0 Likes
Message 25 of 26

SwainStrain
Enthusiast
Enthusiast

Thank you. I resolved the issue by inserting these two property groups in the project file::

 

    <PropertyGroup Condition="'$(Configuration)' == '2024Debug'">
        <RevitVersion>2024</RevitVersion>
        <TargetFramework>net48</TargetFramework>
    </PropertyGroup>
    <PropertyGroup Condition="'$(Configuration)' == '2025Debug'">
        <RevitVersion>2025</RevitVersion>
        <TargetFramework>net8.0-windows</TargetFramework>
    </PropertyGroup>

 

0 Likes
Message 26 of 26

SerhanB
Advocate
Advocate

Batch build is broken so I use a batch file containing follows:

msbuild .\revitadd-in.sln -p:Configuration=R2025 -p:Platform=x64 -t:rebuild -restore -p:RestorePackagesConfig=true -v:m
msbuild .\revitadd-in.sln -p:Configuration=R2024 -p:Platform=x64 -t:rebuild -restore -p:RestorePackagesConfig=true -v:m
msbuild .\revitadd-in.sln -p:Configuration=Debug -p:Platform=x64 -t:rebuild -restore -p:RestorePackagesConfig=true -v:m
msbuild .\revitadd-in.sln -p:Configuration=Release -p:Platform=x64 -t:rebuild -restore -p:RestorePackagesConfig=true -v:m

Serhan BAKIR
http://www.stand.com.tr/
0 Likes