Object Test Bench

  • Thread starter Thread starter A.M-SG
  • Start date Start date
A

A.M-SG

Hi,

My solution consists of 20 c# projects. When I switch to class view and
right click on any class, I don't have the create instance option.



I am using visual studio 2005 professional edition. If I create a simple
winform application, the create instance option in class view.



Is there any reason why I don't have created instance option in bigger
projects?



Thank you,

Alan
 
Hello Alan,

Based on my understanding, the problem is that: Your solution has 20 C#
projects. However, the IDE doesn't have the "create instance" menu item
when you right click on any class in class view. Please correct me if I
have misunderstood anything.

I created a testing solution and 20 testing c# projects. However, it seems
the option is working on my side. Could you please help test from a simple
solution to see whether you can reproduce it on your side?

If it is convenient for you, could you please email us a repro sample and
so we will investigate it for you. Thanks very much.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://msdn.microsoft.com/subscriptions/managednewsgroups/

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Yan,

Do you know any condition for the project or solution that prevent the
classes with project have the "create instance option" ?

Thank you,
Alan
 
Hi Yan,



I think I found how to reproduce the problem; I appreciate if you could
confirm it with Microsoft tem:



Step 1) Use Visual Studio 2005 Professional Edition

Step 2) Create a solution with one WinForms application within it



At this point you have create instance option for all classes within the
class view



Step 3) Add a class library to the solution

Step 4) Go to the class view and choose any class of the class library you
just created

Step 5) Right click on that class, there is no "Create Instance" option!





This behavior seems to be by design, but I am wondering what is the
microsoft official explanation for this limitation.



Thank you,

Alan
 
Oh. I ran into is issue. The solution was that in order to use the
Object Test Bench, the current class you want to test must be within
the current Active Project. So,

1. Find your class
2. Make the project that includes the class as the default active
project
3. You should see the option in the context menu in the class view

Not sure about this one; but I also think your class must define a
default contructor that takes no parameters. I hope everthing you are
able to get it to work this way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top