sapi
sapi

Reputation: 10224

Multiple project solution, 'missing assembly reference' despite including it

I have two projects in the current solution:

abc.Dashboard
abc.ThingyService

abc.ThingyService needs to be able to use a class from abc.Dashboard.

I've added a reference to abc.ThingyService pointing at abc.Dashboard (right click on project -> add reference -> projects -> abc.Dashboard) but it's not recognising that it has been added.

One of the files in the abc.ThingyService project contains:

using abc.Dashboard.Services

When I compile, I get the error:

The type or namespace name 'Dashboard' does not exist in the namespace 'abc' (are you missing an assembly reference?)   

Am I missing something very obvious here? :/

Upvotes: 2

Views: 9077

Answers (2)

Shyju
Shyju

Reputation: 218942

Do you see the entry for Dashboard under the references section of ThingyService project in solution explorer ?

I would give a try to these steps.

1) Remove the reference and readd again and see.

2) Close Visual Studio and reopen it and see

3) Try to add the Project reference instead of selecting the dll while adding the reference.

4) Right click and build the Dashboard project and then build the ThingyService project. If that works, you probably need to check your build order.

Upvotes: 1

Daryl Teo
Daryl Teo

Reputation: 5495

I believe you also need to add the project as a dependency.

http://msdn.microsoft.com/en-us/library/et61xzb3(v=vs.80).aspx

This determines build order, making sure that the linked project has been compiled first.

Upvotes: 0

Related Questions