views:

1099

answers:

3

I'd like to use the Object Test Bench in VS2008. The docs - and even the helpful text in the test bench window - say to right click on class in the Class View. Further reading indicates that this class must be in the startup project or referenced assembly. I've tried this on numerous classes - public, private, static, you name it - in several assemblies (either the startup project or a referenced project), and the context menu item "Create Instance" never appears.

Has anyone had any luck with this? Is this a bug, or am I doing something wrong?

A: 

I can only get it to work in the start up project if the project is a console or windows forms application. It doesn't seem to work with web sites.

BTW. I don't ever use it in practice. And after playing with awhile in the context of trying to figure out why it wasn't working for you, I now know why! Very difficult to do something that ought to be simple on a fully working project.

tvanfosson
Good to know. I'm trying on a WinForms project, though.
Jon B
I could use it with a windows forms application, at least the menus appear. I got an error when I actually tried instantiate an object of one of my classes. I could instantiate some framework classes, though.
tvanfosson
The error seemed to be related to the fact that the namespace and class name were identical (toy project). Works correctly in another project.
tvanfosson
A: 

I know that you couldn't get it to work in VS2005 without installing Visual J++, but that obviously isn't the problem as you are using VS2008. Are you sure you are looking in the Class View and not looking at the classes in the Solution View (I know that sounds stupid, but that was the problem I had getting working the first time I tried to use it).

Kris Erickson
Yes, I'm sure (I've done dumber things, though).
Jon B
+5  A: 

Solved it!

I had multiple projects set to run on startup (I've gotten so used to working that way I didn't even realize there was a difference!).

Setting just one startup project fixed the problem.

Jon B