I am able to create an instance of a class in the Object Test Bench. But everytime I attempt to invoke a method (even an empty void method) of the class, the tool asks me to rebuild it, after which it resets the class and does not execute the method. It does this even though I have not modified the code in any way. I try to execute the method right after I create the instance.
This seems to happen if you have multiple projects in a solution. Is there a workaround
Help!
:)
Steven

Rebuild Issue with Object Test Bench
sagittarian
This is known issue. If solution contains any web related projects then it behaves this way. Please exclude any web projects from your solution and try. We are tracking this issue. Please let me know whether this works or not.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Please provide your valuable feedback or suggestions on OTB and thanks for using OTB
s_ruchit
I went to the configuration manager for the solultion and removed the web site from the build and did a full rebuild of the project. I could then invoke methods of the object I was trying to test.
RAYMOND KNIGHT
I'm unable to use my chat
Nilesh Patel
Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727
Installed Edition: Professional
Steps to produce rebuild issue:
1. Create a new ClassLibrary project: ClassLibrary1
2. Open Class1.vb in ClassLibrary1 and add the following code:
Public Class Class1
Function MyFunc() As String Return "Hello World" End Function End Class
3. Add a ClassDiagram to the ClassLibrary1 project: ClassDiagram1
4. Drag-n-drop Class1.vb onto the ClassDiagram
5. Right-click Class1 on the ClassDiagram then select Create Instance|Class 1()
6. Click "OK" on the Create Instance dialog: Class11 is created in the OTB.
7. Right-click Class11 in the OTB and select Invoke Method|MyFunc(): the Invoke Method dialog opens as expected.
All works fine to this point, now lets make the ClassDiagram dirty by changing something simple.
8. Change "Hello World" to "Hello Universe" in MyFunc()
Public Class Class1
Function MyFunc() As String Return "Hello Universe" End Function End Class
9. Right-click Class11 in the OTB and select Invoke Method|MyFunc(): An Object Test Bench dialog appears saying the project needs to be rebuilt
10. Click "OK" to rebuild the project: Project rebuilds and it clears the OTB window without invoking MyFunc().
At this point I can right-click on Class1 in the ClassDiagram and recreate Class11 in the OTB, but I cannot Invoke the MyFunc() method. When I try to Invoke Method|MyFunc() I get the rebuild project dialog. If I click "OK" to rebuild the project it rebuilds the project again and clears the OTB without invoking the MyFunc() method. Once the project becomes dirty I can never get past the project rebuild dialog to the invoke method dialog.
IgorP
gm64
JohnnyP34
Chintan Jhaveri
Ross B.
There should not be any problem. Could you please provide detailed steps to repro the problem and information on kind of projects you have in your solution. This will help is in diagnosing the problem soon.
kiran1234
pappascd
I am able to create an instance of my class just fine, and I can invoke a method.
If I make ANY changes in the class designer, whether its to my class library or dragging a new class onto the designer or anything that causes the class designer to become dirty, it forces a rebuild of the project. I am still able to create an instance of my class, but I get a message to rebuild my project when I try to invoke a method. I click "ok" to rebuild the project but it never invokes the method. I just get an endless cycle of rebuild messages.
Interestingly enough, if i create a new project in my solution and copy the class library file to the new project it works as long as I don't alter ANYTHING in the class designer. It seems like the class designer and OTB are getting out of sync and rebuilds are not resyncing.
Help!
VB 2005 Class Library; nothing fancy just a hello world type class to test OTB.
Thegamingchoice
If project gets dirty then OTB becomes invalid and OTB Objects need to be recreated, this is by "By Design". But it should work fine after rebuilding the project. I've checked the scenario that you have provided to me on VSTS 2005 for VB and J# projects, it works perfectly fine. If you could provide details steps to reproduce the problem that would be great.
Mark Freeman
We are looking into this issue.
But there is a work around for this problem.
Please check the following setting to turn it on:
Tools -> Options -> Projects And Solutions -> Show Advanced Build configuration.
Now OTB should behave correctly.
Please let me know if this helps.
ReneeC
Thank you for the prompt reply! I did a quick test and it appears to help.
I changed "Hello Universe" back to "Hello World" to dirty the project and got the expected Rebuild Project dialog when I selected Invoke Method. I clicked the "OK" button and it rebuilt the project and cleared the OTB. At this point, I was able the go back to the ClassDiagram and successfully Create Instance and Invoke Method. Does this process sound correct (OTB is cleared and I need to re-create an instance of the class and re-invoke the method)
OTB rocks when it works!!