I\'m getting a:
type or namespace name could not be found
error for a C# WPF app in VS2010. This area of code was compiling fine
I got this error trying to make a build with a Visual Studio Team Services build running on my local machine as an agent.
It worked in my regular workspace just fine and I was able to open the SLN file within the agent folder locally and everything compiled ok.
The DLL in question was stored within the project as Lib/MyDLL.DLL
and references with this in the csproj file:
False
Lib\MYDLL.dll
It turned out it literally just wasn't finding the file despite the hint path. I think maybe msbuild was looking relative to the SLN file instead of the project file.
In any case if the message you get is Could not resolve this reference. Could not locate the assembly
then make sure that the DLL is in an accessible location to msbuild.
I kind of cheated and found a message that said Considered "Reference\bin\xxx.dll"
and just copied the dlls into there instead.