StrataFrame Forum

Debuggin a Type Editor

http://forum.strataframe.net/Topic10014.aspx

By Paul Chase - 7/5/2007

It's late so gonna be short but I am trying to set up a type editor for a custom property but I got some wires crossed somewhere. Problem when I try to use that aforementioned pain in the neck property V.S. just quits.. none of the usual hints like "hey idiot you cant do that" or anything. Any pointers on how to debug this>?
By Paul Chase - 7/5/2007

I found the problem, It ended up that I had a type cast problem. Still is there is a better way than just getting lucky and finding the issue?
By Trent L. Taylor - 7/6/2007

LOL....yeah, that is the life of a type editor developer BigGrin  VS snuffs most type editor exceptions so you either get nothing....or blown out.  There is a way to debug a type editor though....set your project to run an external program on debug (this can be for a class library as well).  Right-click your project and go to properties.  Select the Debug tab.

Next, tell it to start up the VS devenv.exe for the external program.  Now when you run your program in debug (Ctrl+F5) it will launch another session of VS.  But your project with your type editor will break anywhere you place a break point and you can then debug your type editor....very nice trick Wink

By Paul Chase - 7/6/2007

Trent that's the ticket !!

I was hoping that there would be some way to debug it besides >>Try to set property >> Crash Visual Studio >> Stare Blankly at screen >> Restart Visual Studio >> Stare Blankly at code>> Wait till Eyes are blurry and crossed >> try something  >> Try to set property again >> Crash Visual Studio >> Stare Blankly at screen>> you get the picture

I also noticed that when I make a change in the editor the change would not show unless VS is restarted.

 I would guess that setting it up to run as you showed will eliminate that issue in the spawned instance of VS but I still would need to remember to restart the main instance once I am finished debugging.

Thanks alot.

Paul

By Trent L. Taylor - 7/6/2007

LOL....yup...been there BigGrin

I also noticed that when I make a change in the editor the change would not show unless VS is restarted.

If you have your assembly in the GAC then the assembly is cached within VS and will not reload.  Also, there are other times the the assembly will be cached with VS in the AppDomain and you have to get out and come back in for it to work.  When it launches the devenv.exe, it will load the new assembly so you won't have this problem when testing.