Avatar of ElrondCT
ElrondCTFlag for United States of America

asked on 

Referencing main project from unit test project

In Visual Basic 2008, I have created a project for unit tests (working off a database of test data). I was running into some compilation problems caused by it, so I temporarily removed the project from the solution. I'm now ready to reinstate the project, but when I brought it back into the solution, I found that the links between it and the main application project aren't working, and all references to the primary namespace are giving a "not defined" or "not declared" error. The executable is listed in the project's references listing, but it doesn't show up beneath in the available namespaces to import; when I try to Add Reference and select the main project, nothing seems to happen. The project build order has the unit test project last, and it is marked with dependencies on the main project.

It should perhaps be noted that the primary project name is not the same as its namespace; this is because I have two versions of my application, the production and the development versions, and the namespace is the same but the development version has a different project & solution name. For the production version of the solution, the references are working correctly.

Any suggestions for what I'm missing to get the unit test project to see the primary project?
Visual Basic.NET.NET Programming

Avatar of undefined
Last Comment
Avatar of Jeevan Bordoloi
Jeevan Bordoloi
Flag of India image

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of it_saige
Flag of United States of America image

Also, you may try removing the existing reference, cleaning the solution and then re-adding the reference.

Avatar of ElrondCT
Flag of United States of America image


Jeevan, your suggestion worked. I don't know why I didn't think of that! Thanks.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo