As you can see, I'm not actually missing a using statement. When I searched for this problem on the internet, I saw that it was related to the .Net Freamwork version. When I upgraded my class library to 4.8 the errors went away. Later, when I ran my class library that was working on .net core, which was working before, I did not get any namespace errors. Later, I ran revit, but I got this error on both occasions.
Error : System.TypeLoadException Could not load type ' RevitGltfDeneme3.App ' from assembly ' RevitGltfDeneme3 , Version 1.0.0.0 , Culture = neutral , PubliKeyToken = null " .
When I researched the error I was told that I could fix it with Gac or that I should delete and recompile. When I deleted and reinstalled, I got the same error again. I couldn't find exactly how to solve it with Gac. How can I resolve this error.
Solved! Go to Solution.
Solved by nice3point. Go to Solution.
Try using templates, when creating an add-on, select the UI - None option https://github.com/Nice3point/RevitTemplates. This will solve your Assembly reference problems. By the way, unsubscribing from the Idling event should occur at the beginning of the method and not at the end, in case of an exception, unsubscribing will not occur. The use of Static fields is also undesirable.
.Net SDK, not .Net Core. TargetFramework for Revit must use the old one, net48. Revit will not work with plugins written in .Net5+
You should choose proper .net framework version that your add-in is targeting.
Revit itself has a targeting .net framework version -> Version A
Your add-in has a targeting .net framework version -> Version B
Version B must be equal with or lower than Version A
if Version B is greater than Version A, your code compiles but will be failed at runtime.
I did the install in your repo.
When I wanted to install RevitTemplates, I got an error like this.
Error : Error: Failed to load template from "C:\Program Files\dotnet\templates\3.1.26\microsoft.dotnet.winforms.projecttemplates.4.8.1-servicing.22281.3.nupkg(/WinFormsLibrary-CSharp/.template. config/template.json)".
I have installed the latest version of .Net Sdk. Then when I tested it in Revit again, I got the same error again.
I don't know, is there an error in my addin file?
<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
<AddIn Type="Application">
<Name>Application RevitApiDeneme</Name>
<Assembly>C:\Users\oguzhan komcu\source\repos\RevitApi_MyApiProject\RevitApiDeneme\obj\Debug\net6.0\RevitApiDeneme.dll</Assembly>
<FullClassName>RevitApiDeneme.App</FullClassName>
<ClientId>bd9e2e87-544c-49c6-a417-c9af26b400bb</ClientId>
<VendorId>TBC_</VendorId>
<VendorDescription>oguzhan</VendorDescription>
</AddIn>
</RevitAddIns>
Error: Failed to load template from "C:\Program Files\dotnet\templates\3.1.26\microsoft.dotnet.winforms.projecttemplates.4.8.1-servicing.22281.3.nupkg(/WinFormsLibrary-CSharp/.template.config/ template.json)".
I keep getting this error. I tried this template in both .net6.0 and .net 4.8 but got the same error in both. When I try other solutions, I still get the same error in my plugin running on .net freamwork 4.8.
I've got totally confused about what you want to achieve. Why do you want to involve .NET Core or .NET 6. Can you provide some more business scenarios?
My main goal is to convert the desired .rvt file to gltf format in line with the request from my own API application. I want this export process to be done directly when Revit is opened. In another post from From, I got these codes and applied them. I created this in .net freamwork. I got a namespace error due to the version problem and I updated my version to 4.8. But when I wanted to run this plugin in Revit, I got the first error I showed up. The solutions you gave didn't work well or am I missing something?
First of all, I'm sorry because of my own mistake and inexperience, I couldn't upload your templet, but now I created a project with templet. I placed my own code in the Application class. Then I got these errors.
Why can't I choose revit.exe to debug the class library that comes with this template? Is there a different way that I don't know?
Can't find what you're looking for? Ask the community or share your knowledge.