Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Challenges with Revit Add-in Wizard and debugging project

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
epogue
626 Views, 5 Replies

Challenges with Revit Add-in Wizard and debugging project

I have cloned and installed the Revit Add-in Wizard from GitHub using the instructions provided. Note that I have successfully utilized the Revit Add-in Wizard before with earlier versions of Revit & Visual Studio. Very nice tool by the way! I also successfully created and compiled a new Visual Studio 2015 project utilizing the Wizard with no issues. Note that I am working with a new installation of Revit 2017 and Visual Studio 2015. 

 

When I attempt to debug the resulting Wizard generated add-in, the Revit 2017 startup screen appears for a second and then I receive a "The program Revit.exe has exited with code 0" message. It does not make it to any add-in break points, or to the TaskDialog.Show(...) code that I added before Revit 2017 exits.

 

If I then start Revit 2017 outside of the Visual Studio debugger, I receive a  "The publisher of the add-in could not be verified. What do you want to do?" message. I have included a screen shot in "Capture02.PNG" below. I press the "Always Load" button in order to continue. 

 

Even if I go back and attempt to run the add-in from the debugger it still exits immediately. 

 

One final note, I initially saw some type of compiler warning around CPU compatibility; however, I am not able to reproduce that  warning at the moment. 

 

Thoughts?

 

Eric

 

 

Tags (1)
5 REPLIES 5
Message 2 of 6
epogue
in reply to: epogue

Okay, after viewing several other Add-in Wizard posts, I have believe that I have fixed the issue by selecting "Use Managed Compatibility Mode" option under the "Tools->Options" menu and then navigating to "Debugging->General" section of the "Options" dialog. It looks like the default in Visual Studio 2015 is to have the ""Use Managed Compatibility Mode"option un-selected.

 

Note that the same exists in the "HelloWorld" add-in tutorial. 

 

Any final thoughts or guidance on how to best sign the add-in so that the warning does not come up when the add-in is loaded?

 

Regards,

Eric

Message 3 of 6
jeremytammik
in reply to: epogue

Dear Eric,

 

On first sight, I would assume that you are facing two separate issues:

 

The "publisher could not be verified... Always Load..." message is expected and cannot be avoided except by signing your add-in, cf.

 

http://forums.autodesk.com/t5/revit-api/code-signing-of-revit-addins/m-p/5981560

 

The second issue has to do with the Visual Studio debugger settings.

 

You need to toggle the native code debugging setting, or managed code, or something like that.

 

http://thebuildingcoder.typepad.com/blog/2016/04/rvtsamples-for-revit-2017.html#4

 

I hope this resolves all your issues and you live happily ever after.

 

Cheers, 

 

Jeremy.



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 4 of 6
jeremytammik
in reply to: epogue

Oh no!

 

You were faster yourself!

 

Nope, please refer to the discussion thread I already pointed out.



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 6
brian.k.smith
in reply to: epogue

This solution resolved the issue that I was having when attempting to use interactive debugging!

I'm using VS 2015 with Revit 2016.

Message 6 of 6
jeremytammik
in reply to: epogue

Please also do not overlook the fact that in most cases, 'attach to process' is probably more effective than using the Visual Studio debugger to launch Revit.exe, since it enables you to unattach, edit, recompile reattach and continue without having to restart Revit and reload the project:

 

http://thebuildingcoder.typepad.com/blog/2016/10/ai-edit-and-continue.html#2

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community