Hello all,
I've just installed Visual Studio 2013, but can't get it to debug revit addins properly. I'm running VS as admin, .NET 4.0. Projects debug fine in VS 2012, but in VS 2013 the project will start and revit will load, but all of my modeling commands are disabled. I can switch views, open projects, etc., but I can't, for example, create a wall or run an addin.
My addins run fineApp runs fine outside the debugger, but when debugging the Revit ribbon looks like this with most modeling commands disabled:
Can anyone tell me how to fix this?
Thanks!
Did you find a solution to this? I am having the same problem.
Hey guys,
Have you tried switching to managed compatibility mode?
I have not tried myself, because I am still happily using Visual Studio 2010 🙂
Cheers,
Jeremy
"...because I am still happily using Visual Studio 2010."
Jeremy, we know you want some of that edit-and-continue stuff... 😉
Compatibility mode causes 2013 debugger to do its duty, but alas, no edit-and-continue.
Thanks for the tip!
Hey Brett,
Wow! Congratulations! Well done!
Can someone please confirm that this works?
Thank you for sharing!
Kudos from me!
Cheers,
Jeremy
Update. I find that the disabled ribbon problem when debugging with Visual Studio 2013 does not manifest if I compile my code, run revit 2014 and then attach to process. Using this technique, I can have Managed Compatibility mode toggled off.
I should have tested this earlier.
1) Compile code
2) Configure your .addin file to load your debug DLL
3) Run Revit (confirm that your addin is loaded)
4) In VS 2013, choose DEBUG --> Attach to process
5) Choose Revit.exe
Brilliant! Thank you for sharing this important discovery! May I promote this to a post on The Building Coder, please? Thank you! Cheers, Jeremy
Great, thank you!
One more question, or a few...
Why in heaven's name are you doing this?
🙂
I mean, what is the advantage?
Does edit and continue work with Revit add-ins?
What are the exact steps for making use of that with a Revit add-in?
Are there any other significant advantages?
Thank you!
Cheers,
Jeremy
"Why in heaven's name are you doing this?"
Well, by the time it occured to me it occured to me that edit-and-continue couldn't work with a DLL I had already installed VS 2013 and didn't want the additional overhead of also installing VS 2012. Therefore, on I pressed. I discovered the 'attach-to-process' trick when trying to get the beta Revit to debug on a remote computer (since it would crash when I attempted to start it directly.) Attach to Process worked, so I tried it on my Visual Studio 2013 computer with locally installed Revit. Lo and behold, it worked and the ribbon behaved.
"I mean, what is the advantage? " None, since it doesn't work! However, if you could use edit and continue it would be like the VBA / LISP days when you could write a problem as you debugged it when we used often to write throw-away code to fix problem in AutoCAD drawings. Code could be written and executed so quickly that it wasn't worth keeping the program since by the time it was needed again it was quicker to re-write it than to find it again. But I'm describing a problem somewhat unique to corporate developers where we often have to address a very specific, often unique occurence.
"Does edit and continue work with Revit add-ins?"
I wish it did. Maybe in heaven... 🙂
Hi Trevor,
It is live on the blog now:
Thank you!
Cheers,
Jeremy
Hi again,
Here is an update on this; edit and continue of a Revit 2014 add-in with Visual Studio 2013 may work partially after all, at least in non-graphical views:
Could you check it out, please, and let us know how it goes?
Mille grazie!
Cheers,
Jeremy
Jeremy, I can confirm that it fixes a lot more than just that. I'm now using Visual Studio Community Edition Update 4 as per your blog, and it also fixes the following issues:
1) TaskDialog throwing an exception saying it had to be in the main thread.
2) LoadFamily() not working - returning false (not throwing an exception).
I am so glad I read this thread!
A huge thanks to Brett for that setting.