When adding a new unit test to my test project, the Unit Test Wizard jumps back to the "Add New Test" dialog when I select certain projects. If I try to click either the '+' sign for the tree structure of the project or try to click on the project's CheckBox, the dialog returns to "Add New Test". Is this because test units cannot be auto-generated for this project, and if so why do I not see some form of message dialog
--Edit--
I also attempted to create a test unit directly from the class that is to be tested. I received the error: "The source code cannot be sufficiently parsed for Code Generation. Please try to compile your project and fix any issues." My project compiles fine and I don't see any errors when running. I'm assuming this is my problem with the unit test wizard, so I will try to implement the test units manually if there is no way around this parsing problem.
-nate

Unit Test Wizard doesn't let me select certain projects.
Mamta M
The problem I found was localized to testing a VB project.
Can you give me any more info
Was this project ported Is there any code outside of all namespaces
The latter should not be a problem, but I'm trying to guess where the problem may be starting.
If you have a small repro to share, that would be great.
Joe
Jitani
OK. Bring up the project settings. Select the 'Resources' tab. It most likely will tell you that you have no resource file associated with the project - and do you want to create one.
Go ahead and create one. Having it be empty is just fine - We also seem to have an assumption that this always exists in VB projects - which is the case in a VSTS created VB project.
Joe
B-soft
First of all, thank you for your reply! I was afraid this thread had been inactive for too long. As for the questions, don't worry about it. I should have been more specific but figured you might've received enough questions about this issue by now to be able to answer in general terms.
I am running this on a VS2005-created web site, on my localhost IIS. The entire solution is stored in SourceSafe2005 and is being shared among 8 developers who do not have the same problem I am having. They can generate unit tests without any problem.
Additionally, if I create a new solution and test project and include the website in the solution, I still get the same problem occurring.
Today I migrated the website to a Web Application Project successfully (and quite seamlessly, I might add... great job Microsoft!), but I am still getting the same error.
One last piece of information that might be important is that unit test generation was, at one point, working without problems. But since there are 8 developers working on this it's kind of hard to pinpoint exactly when this began happening.
Thank you for your help.
grantmi
-nate
kaku Mohanty
Hi guys.
First, I would like to know if VB or C++ are involved, or if this is all C#.
These errors are caused because the object model layered over the source code is having problems parsing. Obviously, this should only happen when the program is not syntactically correct - and this is not what you are seeing.
I would like to know also if you are failing just expanding a node in the 'selection' dialog, or when the code is actually being generated. If it is when selecting what to generate tests for, are any of the nodes expandable in the problematic projects, or will any expansion trigger the failure.
Finally, if your repro of this problem is on source code you can send out, it would be great if I could work on the problematic sln. If that's possible, let me know and we'll coordinate it.
Joe
Ellswogs
I would like to confirm. You have the problem with a C# Web Site project.
If you make an empty solution and add just the 'existing' C# Web Site project to the solution, do you still have the problem
Is this a VS2005 created Web Site, or an upgrade of a web site project from a previous version
Is this a file-system Web Site project, or an IIS URL If it is an IIS URL, is it localhost, or on a remote host
Sorry for so many questions, but there are so many configurations for web site projects, it can be hard to nail down what's happening.
Joe
Kenneth Wohlers
HI
I get this eact same problem in C#,but this solution does not seem to oslve it. Can you pelase help
Thanks
ELB
PareshC
hommer
I am working with VB.
This problem occurs when I try to expand certain projects, not all of the projects. The projects that this occurs for are ones that also fail to parse when I try to auto generate a test class from right-clicking on the class name in the class's code view.
I will try to come up with a sample of the occurrance.
--Edit--
It seems that all of the classes in a certain project prevent unit test creation. My projects were converted over from VS 2003. Could there be a configuration problem with the project
-nate
Thinh
Hey Guys.
I have something I'd like you to look into.
Right Click on your project, bring up 'Properties'. On the 'Application' tab, see if 'Enable application framework' is turned off.
If it is, please turn it on. See if this does not resolve the problem and let me know.
If my repro is sufficient, it looks like these options are always on in a new application, and almost always 'off' in a converted project - and we do not deal with it well in the current version.
Please let me know if this works around the problem for you!
Joe
Sm00ches
OK. The root of the problem is the way we enumerate code elements for VB projects and rely on project settings.
I'll have to see if I can find something that fixes class libraries as well. Sorry for the delay.
Studioj
Let me try converting some 2003 projects and see if that's sufficient to repro. If this turns out to be the issue, hopefully I will be able to get you a work around.
Thanks!
Joe
cdolphin88