Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Challenges with Revit Add-in Wizard and debugging project

Anonymous

Challenges with Revit Add-in Wizard and debugging project

Anonymous
Not applicable

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

 

 

0 Likes
Reply
Accepted solutions (1)
766 Views
5 Replies
Replies (5)

Anonymous
Not applicable

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

0 Likes

jeremytammik
Autodesk
Autodesk
Accepted solution

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

jeremytammik
Autodesk
Autodesk

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

0 Likes

brian.k.smith
Advocate
Advocate

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

I'm using VS 2015 with Revit 2016.

0 Likes

jeremytammik
Autodesk
Autodesk

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