Compilation Issue with .DLL for Autodesk Revit 2025

Compilation Issue with .DLL for Autodesk Revit 2025

Storm_Clayton
Explorer Explorer
902 Views
2 Replies
Message 1 of 3

Compilation Issue with .DLL for Autodesk Revit 2025

Storm_Clayton
Explorer
Explorer

Hello everyone,

I am currently facing a compilation issue with my .DLL file for Autodesk Revit 2025. Despite following the official documentation and relevant examples, I am encountering errors during the build process. Notably, this issue did not occur in previous versions of the product.

Here are the specifics of my setup:

  • Development Environment: Visual Studio Community
  • Revit Version: 2025.3
  • Error Messages: "You cannot directly start a project with a class library output type. To debug this project, you need to add an executable solution that references the class library project. Set the executable project as the startup project."

I would greatly appreciate any guidance or suggestions on how to resolve this issue. If anyone has experienced a similar problem or can direct me to pertinent resources, it would be immensely helpful.

Thank you in advance for your assistance!

Best regards,

0 Likes
903 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

This is not actually a compilation issue, but a debugging one. In the new version of Visual Studio and using .NET Core, the method to set up your Revit add-in project as a class library to be loaded into Revit.exe and set the debugging target to launch Revit.exe has changed. I saw an explanation here in the forum recently on how to do this in the context of the new environment. I'll take a quick look for you. 

   

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

moturi.magati.george
Autodesk
Autodesk

Hi @Storm_Clayton 

You can create a Properties folder in your project folder, then add launchSettings.json file. The contents of the file can be as below

{
  "profiles": {
    "Sample Project": {
      "commandName": "Executable",
      "executablePath": "C:\\Program Files\\Autodesk\\Revit 2025\\Revit.exe"
    }
  }
}

 

  Moturi George,     Developer Advocacy and Support,  ADN Open
0 Likes