I have a Windows Forms application that I wrote several years ago (my first production C# application actually) that occasionally throws an exception when it starts. The Error message says "Window Class Name Is Not Valid" and it happens when the startup code tries to show the main form.
I did some searching around and found that there are several people that have encountered the same error. In my case, it only happened when I tried to debug the program. It used to happen once, and then I would retry running the program and it would work correctly. I hit the wall though, this time it happened every time I executed the application.
I read this fairly lengthy thread about the problem. The solution that worked for me was turning off the Visual Studio Hosting Process.
Right click on the project that is giving you trouble, select properties, select the Debug tab. The Visual Studio Hosting Process selection is a check box at the end of the list. When I unchecked it, my project would debug every time.
Thursday, December 4, 2008
Subscribe to:
Post Comments (Atom)

2 comments:
You have saved the day for me. Many Thanks!
Same as me, i tried your solution, and it worked right away. many thanks.
Post a Comment