Conflicts building Revit 2025 Plugin with .Net Framework 4.8

Conflicts building Revit 2025 Plugin with .Net Framework 4.8

m.walterN99B3
Contributor Contributor
4,909 Views
9 Replies
Message 1 of 10

Conflicts building Revit 2025 Plugin with .Net Framework 4.8

m.walterN99B3
Contributor
Contributor

Hi,

I converted my plugin from Revit 2024 to Revit 2025 using the RevitAPI.dll and RevitAPIUI.dll.

Now I get a lot of conflicts building the project and the plugin crashes Revit.

I'm using the .Net Framework 4.8

and the following includes:

 

<Reference Include="PresentationFramework" />
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
<Reference Include="System.Core">
<Reference Include="System.Xml.Linq" />
<Reference Include="WindowsBase" />

 

A part of the build message is:

 

1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277: Found conflicts between different versions of "PresentationFramework" that could not be resolved.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277: There was a conflict between "PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "PresentationFramework, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".

Accepted solutions (1)
4,910 Views
9 Replies
Replies (9)
Message 2 of 10

jeremy_tammik
Alumni
Alumni
Accepted solution

That is expected. Please look at the Revit Platform API Changes and Additions.docx document included in the Revit 2025 SDK:

  

Revit now on .NET 8

  

The Revit API for Revit 2025 is built on .NET 8. This upgrade keeps Revit up-to-date with the latest .NET features, performance improvements, and security fixes.

  

Addins for Revit 2025 will need to be rebuilt on .NET 8.

  

The SDK can be downloaded from the Revit developer centre:

  

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 10

nice3point
Advocate
Advocate

You need to update the csproj file to SDK format, and change the TargetFramework to net8.0-windows:
https://github.com/Nice3point/RevitTemplates/blob/develop/samples/SingleProjectApplication/RevitAddI...

For easier migration, you can use templates that support multiple versions of the Revit API, including 2025
https://github.com/Nice3point/RevitTemplates

Message 4 of 10

c_hanschen
Advocate
Advocate

Hello Revit API heroes!

 

***** upgrade tot .net 8.0 fails, even for new clean Revit 2023 project *****

 

I have been building Revit add-ins since Revit 2015, all build tot .net framework.

I now want to  start with a clean Revit 2025 addin, starting by setting up a 'hello world'.

 

My Approach:

#1 installed Revit Addin Template

https://github.com/jeremytammik/VisualStudioRevitAddinWizard

 

#2 Setup a new project from this template (Revit 2023)

Removed the ExternalCommand, remaining The ExternalApllication

 

#3 Build & TEST

New project 'Hello World' for Revit 2023 succeeded!

 

#4 Upgrade using this steps:

https://thebuildingcoder.typepad.com/blog/2024/04/the-building-coder-samples-2025.html#3

 

Upgrade succeeded, but error when building:

 

Severity Code Description Project File Line Suppression State
Error BC30002 Type 'Global.Microsoft.VisualBasic.MyServices.Internal.ContextValue' is not defined. 

Error BC30002 Type 'Global.Microsoft.VisualBasic.ApplicationServices.User' is not defined.

Error BC30002 Type 'Global.Microsoft.VisualBasic.Devices.Computer' is not defined. 

Error BC30002 Type 'Global.Microsoft.VisualBasic.ApplicationServices.ApplicationBase' is not defined. 

 

I Tried 'Google', but can't fix the problem.

 

Tried to find a new Revit 2025 template online, even started new project from scratch, but I got stuck!

 

I need it to be VB.Net (Not CS), because my previous projects are all in VB.net

 

Who can help me out? 

 

Thanks in Advance!

 

Chris Hanschen

LKSVDD architecten

The Netherlands

 

 

 

0 Likes
Message 5 of 10

haluk_uzuner
Explorer
Explorer
Hi Cris,
You and I are very odd in the universe. This is c# universe.
I am sturuggling to move my project to .net 8.0 which written in c++. Until now I couldn't find any solution. I created c++ project with winu because WindowsForm is not supported (Design view doesn't work). But I can't add RevitAPI.dll file as reference. It returns error "couldn't add a reference to RevitAPI.dll it is not a type or version current project can use"
Is tehre anybody have the same peoblem and solved it?
0 Likes
Message 6 of 10

c_hanschen
Advocate
Advocate

Hi @haluk_uzuner ,

 

I got it all working in vb.net!

 

I started a new project in Visual Studio: Windows Forms Class Library (.net 8.0)

 

Maybe you can do the same for C++ ?

 

So even WindowsForm are supported!

 

Chris Hanschen

LKSVDD architecten

The Netherlands

0 Likes
Message 7 of 10

halukuzuner
Advocate
Advocate

Hi Cris,

 

I wrote the problem to Microsoft. Topic link is https://learn.microsoft.com/en-us/answers/questions/1663087/net8-windows-form-design-view-problem
This solution works. But it still needs adding form control by code. It is not comfortable.
I tried WinUI template in Visual Studio. But in that case I couldnt add RevitAPI.dll as reference.
Could you share your VB template. It may help.

0 Likes
Message 8 of 10

c_hanschen
Advocate
Advocate

@haluk_uzuner 

 

see attached zip-file!

 

info.png

And Yes, even WindowsForm are supported!

 

Modifications to vbproj-file:

  <PropertyGroup>
    <TargetFramework>net8.0-windows</TargetFramework>
    <UseWindowsForms>true</UseWindowsForms>
    <usewpf>true</usewpf>
  </PropertyGroup>

 

Chris Hanschen

LKSVDD architecten

The Netherlands

0 Likes
Message 9 of 10

halukuzuner
Advocate
Advocate

Hi Chris,
Thank yo for your post. It didn't work for me. Think Microsoft Visual Studio has some limitations on c++. I created attached sample project.

halukuzuner_1-1716360391962.png

 

 

Form designer tools are limited.

halukuzuner_0-1716360333264.png

And it returns error "C1001 Internal compiler error."

Message 10 of 10

halukuzuner
Advocate
Advocate

I finally got it working. WindowsForm design view is also working. I tested on two diffrent computers in Revit 2025.

I put simple project on GitHub.

https://github.com/halukuzuner/RevitAddinCppNet8.0