2

I seem to be getting some weird errors while rebuilding the project.

I have a project in witch I have stored all my DomainService. If I right click on the solution and select clean solution then rebuild the project I get a bunch of this errors:

Error 104
The type or namespace name 'Practices' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
D:\Projects\Backend\WebApi\DomainServices\LocalizationService.cs

I get errors for each file where I have imported this namespace:

using Microsoft.Practices.ServiceLocation;

Now I have already added a reference to the assembly.

The weirdest thing is that if I rebuild again everything works and no errors are displayed.

Does anyone have any ideea what's going on?

aleczandru
  • 5,319
  • 15
  • 62
  • 112
  • Which version of Visual Studio are you using? – User 12345678 Jul 01 '13 at 08:29
  • Maybe related http://stackoverflow.com/questions/3992072/where-does-microsoft-practices-servicelocation-come-from – Soner Gönül Jul 01 '13 at 08:30
  • *could be* some target framework versions mess in your solution, if you have multiple projects which target different framework versions – Tigran Jul 01 '13 at 08:30
  • Yeah, when you clean your program it wipes everything, references the whole lot, so that when you rebuild you are building the newest references in your code. Hence you get a reference error. – Philip Gullick Jul 01 '13 at 08:30

1 Answers1

5

Possibly you have wrong build order, visual studio tries to do this in good way, but sometimes it fails

http://social.msdn.microsoft.com/Forums/windows/en-US/34fcc251-b6fe-4878-8274-fa094ae34151/how-do-i-set-the-build-order-of-projects-in-visual-studio-solution

Kamil Budziewski
  • 22,699
  • 14
  • 85
  • 105