我有两个引用一个SQLite装配,一个用于32位和一个64位,它看起来像这样(这是一个测试项目,试图摆脱的警告,不要在挂了路径):.NET项目中的条件引用,有可能摆脱警告?
<Reference Condition=" '$(Platform)' == 'x64' " Include="System.Data.SQLite, Version=1.0.61.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=AMD64">
<SpecificVersion>True</SpecificVersion>
<HintPath>..\..\LVK Libraries\SQLite3\version_1.0.65.0\64-bit\System.Data.SQLite.DLL</HintPath>
</Reference>
<Reference Condition=" '$(Platform)' == 'x86' " Include="System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86">
<SpecificVersion>True</SpecificVersion>
<HintPath>..\..\LVK Libraries\SQLite3\version_1.0.65.0\32-bit\System.Data.SQLite.DLL</HintPath>
</Reference>
这将产生以下警告:
Warning 1 The referenced component 'System.Data.SQLite' could not be found.
是否有可能对我来说,摆脱这种警告?
我研究过的一种方法是在开发时将我的项目配置为32位,让构建机器在构建64位时修复参考,但这看起来有点尴尬,可能很容易错误。
还有其他的选择吗?
我想摆脱它的原因是,警告显然是由TeamCity拾起并定期标记为我需要看的东西,所以我想完全摆脱它。
编辑:每答案,我想这:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
...
<SqlitePath>..\..\LVK Libraries\SQLite3\version_1.0.65.0\32-bit</SqlitePath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
...
<SqlitePath>..\..\LVK Libraries\SQLite3\version_1.0.65.0\32-bit</SqlitePath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
...
<SqlitePath>..\..\LVK Libraries\SQLite3\version_1.0.65.0\64-bit</SqlitePath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
...
<SqlitePath>..\..\LVK Libraries\SQLite3\version_1.0.65.0\64-bit</SqlitePath>
</PropertyGroup>
,然后在我的参考:
<Reference Include="System.Data.SQLite">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(SqlitePath)\System.Data.SQLite.DLL</HintPath>
</Reference>
这摆脱了警告,但它是正确的?
我已经编辑我的答案跟我的想法是正确的,你可以看看它,并告诉我,如果这是你的意思? – 2010-04-06 10:26:37
@Lasse:这看起来是正确的。 – Richard 2010-04-06 11:22:02