views:

63

answers:

0

I have one .NET 4 DLL for which I'm having trouble generating unit tests. I'm using VS 2010 Standard. Every other project in the solution will generate unit test stubs for classes just fine. For the other assemblies, I can go into the existing code, right click the class name, and select "Create Unit Tests". I get the selectiong window that follows just fine.

The one assembly that I really need to get some coverage on won't generate the test stubs using the same methodology mentioned above. I go to a class in the project/assembly, right click, select "Generate Unit Tests", and I'm met with the following error:

"Unit Test Generation Error: The follow error was encountered while reading module 'xx.Core': Could not resolve type reference: [System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxx]System.Web.Routing.RouteValueDictionary."

As far as I can tell, there are no direct references int he project to the framework 2.0 version of System.Web mentioned in the error message. Searching the directory that contains the project and .cs files with a tool called grepWIN to see if the text for that reference exists in any files yeilds zero results. Is it even possible to reference both the 2.0 and 4.0 version of the system.web dll at the same time, and if so, why would you want to do that?

Any ideas on how to get rid of this error message so that I can properly stub out some unit tests?

Thanks very much!