Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Debug.WriteLine not allowed in custom TypeConverter?
 

Debug.WriteLine not allowed in custom TypeConverter?

I've created a custom TypeConverter to be able to showvalues in a Combobox on a wizard page.

It works great!

But, after the concept was proven I added some logging using Debug.WriteLine.

Immediately the Combobox showed a red exclamation mark on clicking on the arrow.

Using the debugger I found out that the logging code cause this, but there was no error at all.

The method just returned like there was an exception and the red exclamation mark said "Invalid value".

After removing just the Debug.WriteLine it worked fine again.

Can someone explain this behaviour to me?

Greyfox  Wednesday, March 12, 2008 2:52 PM
Hi Jean,
The Debug.WriteLine should not affect your type converter, check if you already have implemented the IsValid method.
Let me know if you still have troubles with that.

jose.
Jose Escrich  Wednesday, March 12, 2008 7:17 PM
Hi Jean,

As Jose correctly points out, Debug.WriteLine shouldn't affect at all Type Converters as they're not related in any way.

Based on this I think this is not a GAX related issue but we should be able to help anyway if you can post your type converter code.

thanks,
-Victor.
vga  Thursday, March 13, 2008 1:58 AM
Hi Jean,
The Debug.WriteLine should not affect your type converter, check if you already have implemented the IsValid method.
Let me know if you still have troubles with that.

jose.
Jose Escrich  Wednesday, March 12, 2008 7:17 PM
Hi Jean,

As Jose correctly points out, Debug.WriteLine shouldn't affect at all Type Converters as they're not related in any way.

Based on this I think this is not a GAX related issue but we should be able to help anyway if you can post your type converter code.

thanks,
-Victor.
vga  Thursday, March 13, 2008 1:58 AM

I'm too ashamed to tell what it was, but it was a bug in my debug statement. I had expected an error (runtime or compile time)for such a bug, but that didn't happen.

Ialso suspected that it couldn't be caused by the fact thatit was in a TypeConverter, but at that time I couldn't figure out what it was.

It was a nice lesson andthanks for the quick replies.

I can move on now with my greatly working dropdown in my wizard page. :-)

Greyfox  Thursday, March 13, 2008 11:55 AM

You can use google to search for other answers

Custom Search

More Threads

• Error trying to install or uninstall GAX
• Application Block Software Factory templates don't appear in VS 2008
• registry entry for GAT and GAX
• How do I Migrate Guidance Packages from VS2005 to VS2008?
• Cannot install GAX/GAT June 2006 CTP
• Need the June GAX MSI
• June GAT Installation Issues
• Problems with Adding WCF Guidance Package
• Code Snippets not uninstalling
• Windows Installer XML project for GAT Package?