Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 11, 2010 06:29 PM by anglicangeek
Nov 30, 2009 10:21 PM|LINK
We wrote a series of tests in a separate project and included that with the test runner site (instead of putting the tests under App_Code). Running interactively in VS 2008, we've had no problems. Running the test using the test runner (November drop),
it will work the first time. Running it again after that and making no changes, we get the error "Could not find any types marked with WebTestClass attribute". Once we do this, we cannot run again using the runner or the URL itself in or out of the IDE without
Thanks for any ideas.
Dec 22, 2009 01:24 PM|LINK
Hello, I haven't seen this, but it should be easy to repro. I will give it a try and let you know.
Dec 22, 2009 01:42 PM|LINK
Update: So far I have been unable to repro this problem. I build a separate .dll with tests and referenced it in a new WebApplication (from reading your comment I assumed this is what you are doing).
I open a browswer, navigate to the runner frameset and I can run the tests any number of times with no problems.
Did I miss interpret your scenario? Otherwise, could you provide some more information on how to repro?
Jan 06, 2010 05:00 PM|LINK
Thanks for looking into this.
Yes, we have the site we want to test separate from the testing site. We've created a project with all of the tests defined and added that as a reference to the testing site. The first time through using the test runner, the test runs fine. The next time,
we get the error. I can run the test interactively (as long as it is not already getting the error) over and over with no problem. Once it encounters the error, it doesn't work in either situation (testrunner or interactively).
Jan 06, 2010 05:55 PM|LINK
Interesting. I am not sure I am getting what you mean by "testrunner" and "interactively".
I assume, interactively, you mean loading the browser with the frameset that has the treeview of tests, selecting some and clicking run. Is this correct?
What do you mean by "testrunner"?
Jan 06, 2010 06:18 PM|LINK
Sorry for being unclear - by interactively I mean bringing up the browser and running the test page there.
Test runner = LTAFRunner.exe
Jan 06, 2010 09:55 PM|LINK
Here are a few more things that might help track down the reason for the issue:
In TestCaseManager.cs, GetTestTypes is the function that is throwing this exception. The number of assemblies returned by AppDomain.CurrentDomain.GetAssemblies is different the first time through than the second time through. The first time through our
test assembly is included in that set but it is not in the second.
There is a virtual directory created by the runner using the path passed in. That virtual directory doesn't get removed when the code is done but using that virtual directory interactively after it is created fails just as running the LTAFRunner a second
time. Similarly, any virtual directory that previously existed that points to the same files also fails after running the LTAFRunner. Removing the virtual directory that is created doesn't clear up the issue.
Since I had the code for the test runner (LTAFRunner.exe), I made a modification to see if the creation of the virtual directory is causing the problem. I added a parameter to input the virtual directory name to use instead of creating a new one and modified
the code that is doing that to skip the code that creates the virtual directory if that parameter is defined. After compiling the exe, I ran the test runner from the command line and with this modification I can run the tests multiple times without getting
I would think that was the issue except we have had another person set up just the test website and try running the site interactively (using the browser and not the test runner) who is seeing the same second and subsequent run issues.
Jan 11, 2010 06:29 PM|LINK
I've been trying to repro your issues, and I'm sorry that I've still not been able to. This is what I did to try to create a simple repro, step-by-step (please let me know if I should make any changes):
Do you have a simple repro you could send me (my email alias is drewmi, and it is at microsoft.com)? If the same solution has issue for you and not for me we can focus the investigation on environmental concerns. Thanks!