3

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?

4

2 回答 2

1

作为记录,在注册表中添加以下键后,VS可以解析我们的引用:

键:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\AssemblyFolders\ProjectName
值:
“D:\AIS\Projects\Framework\Bin”

在注册表中玩很少感觉是正确的事情,但在我们的情况下,它解决了问题。不过,我仍然会接受一个可以阐明整个事情的答案。

于 2011-05-20T09:07:45.623 回答
0

就我而言,问题是我的项目指定的目标 .NET 框架版本低于引用的项目

于 2016-04-05T13:04:15.997 回答