Create UI for Revit 2025 based .Net 8

Create UI for Revit 2025 based .Net 8

manhgt214
Enthusiast Enthusiast
658 Views
5 Replies
Message 1 of 6

Create UI for Revit 2025 based .Net 8

manhgt214
Enthusiast
Enthusiast

From Revit 2025 based .Net 8 so I can't add a class WPF or Windows Form.
So how to create UI in .Net 8

Use Avalonia like wpf?

Many Thanks!

0 Likes
Accepted solutions (1)
659 Views
5 Replies
Replies (5)
Message 2 of 6

Mohamed_Arshad
Advisor
Advisor

Hi @manhgt214 

You have missing tag in the csproj. Check your csproj file and add below tag in the csproj. Restart the visual studio after adding the below tags.

<!--If you need add WPF use below tag-->
<UseWPF>true</UseWPF>
<!--If you need add WindowForm use below tag-->
<UseWindowsForms>true</UseWindowsForms>
<!--If your plugin has both WPF and Winform the use both-->

Hope this will helps 🙂


Mohamed Arshad K
Software Developer (CAD & BIM)

Message 3 of 6

manhgt214
Enthusiast
Enthusiast

Thank @Mohamed_Arshad,!
I added that text to "csproj" then can add WPF & WinForm
but both not work.

 

manhgt214_0-1744874407843.png

 



0 Likes
Message 4 of 6

Mohamed_Arshad
Advisor
Advisor
Accepted solution

Hi @manhgt214 

You are missing tag in csproj. I have created a sample Revit API project, Kindly check the attached project.

<PropertyGroup>
	<TargetFramework>net80-windows</TargetFramework>
	<UseWPF>true</UseWPF>
	<LangVersion>latest</LangVersion>
	<UseWindowsForms>true</UseWindowsForms>
	<ImplicitUsings>enable</ImplicitUsings>
	<Nullable>enable</Nullable>
</PropertyGroup>

 

Hope this will Helps 🙂


Mohamed Arshad K
Software Developer (CAD & BIM)

Message 5 of 6

manhgt214
Enthusiast
Enthusiast

Thank you! 
my project not work coz default is multi platform
I need change to windows.

default is: <TargetFramework>net8.0</TargetFramework>
need change to:
<TargetFramework>net80-windows</TargetFramework>
or
<TargetFramework>net8.0-windows</TargetFramework>
Message 6 of 6

Mohamed_Arshad
Advisor
Advisor

Hi @manhgt214 

 

Yeah I have noticed that one, So only created a sample project and shared with you. Happy that your problem has been solved !. Happy Coding:)


Mohamed Arshad K
Software Developer (CAD & BIM)