Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2010 project -- unresolved references (where HintPath property missing)

We are in the process of changing our build computer to a new one and at the same time to Visual Studio 2010. We have around 500 different small components, each one an own csproj file, all of them having references to assemblies in a "\Framework\bin\" directory.

After getting the whole source code and starting compiling our projects, we've ran into a problem: many references cannot be resolved, but not all of them, and not always the same references on different projects. The problem seems to be linked to the HintPath attribute of the csproj files.

Specifically, here's an example for a reference that can be resolved:

<Reference Include="AIS.Common, Version=8.1.0.1, Culture=neutral, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\..\..\Framework\Bin\AIS.Common.dll</HintPath>
</Reference>

And here's one that can't:

<Reference Include="AIS.ControlLib, Version=9.1.0.1, Culture=neutral, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
</Reference>

Strangely, the properties of the two references in Visual Studio are exactly the same (except for their Name and Identities, of course). So it seems that HintPath is auto-generated, but why only on some references?

We suspect the problem could arise from using different version of Visual Studio (of the 500+ projects, some are in VS2005, others in VS2008, others still in VS2010), but we could not narrow the behaviour down to something logical.

Is there any way to compile our projects without having to resort to manually reattach the unresolved references?

like image 987
Fueled Avatar asked Dec 15 '25 14:12

Fueled


1 Answers

For the record, after adding the following key to the registry, VS could resolve our references:

Key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\AssemblyFolders\ProjectName
Value:
"D:\AIS\Projects\Framework\Bin"

Playing in the registry rarely feels like the right thing to do, but in our situation, it solved the issue. I would still accept an answer that would shine light on the whole thing, though.

like image 177
Fueled Avatar answered Dec 19 '25 07:12

Fueled