Debuggin a Type Editor


Author
Message
Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
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>?
Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
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?
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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


Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
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

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search