@ali_safieddineSNTCU wrote:
Before diving into details. My situation is that I have a WPF Application (.NET 6.0) and I want to connect it to my Revit API Addin (.NET Framework 4.8) noting that the 2 projects are in the same solution. The first error I get is that the 2 frameworks are not compatible! So what is the solution for that?
That's tricky, why do you have a WPF Application (.NET 6.0), Is there some specific reason?
If is possible to change the project to .NET Framework 4.8 would be easier and the project needs to be a Library instead of the WPF application. You could build to support .NET Framework 4.8 and .NET 6.0 at the same time.
But if you cannot change, that is the Inter-Process Communication (IPC) route, using Pipes communication for example. The complexity goes to the roof, and most of the time it is not worth it.
My second question: Is this the best approach? I can see that separating the project is better for collaboration and provides more options. But is it the best practice or the WPF has to be inside the Revit API project?
Usualy is a good idea to separate the UI (Wpf) with the non UI stuff. Two separated project gonna depend, if you have a big project and you gonna reuse the UI outside Revit like a mock or something else, makes sense to separate in two projects.
If not, put everything in the same project, just organize the project with folder, like UI or Views.
The RevitLookup has a RevitLookup.UI project with all the UI and custom style, font, etc. It is a custom UI and a separate project is easier to maintain in that case. And a RevitLookup.UI.Demo is possible run a UI version outside Revit.
The RevitAddin.CommandLoader does not have a separate UI project, it only has a Wpf with a textbox and a button, and the style is the default.
I usually prefer the monolithic plugin approach, but in some projects, everything together gonna be a mess.