我用的是VS 2015 U1。我使用具有奇怪版本控制的外部库 - 1.0.4056.40164.
我为此库添加了一个 .Fakes 文件。当构建 fakes 程序集时,我收到以下警告:
C:\Somewhere.Test\f.cs(21,58): warning CS7035: The specified version string does not conform to the recommended format - major.minor.build.revision [C:\Somewhere.Test\obj\Debug\Fakes\rs\f.csproj]
Run Code Online (Sandbox Code Playgroud)
我已在 .Fakes 文件中指定:
<Compilation>
<Property Name="NoWarn">CS7035,7035</Property>
<Property Name="DisabledWarnings">7035;1607</Property>
</Compilation>
Run Code Online (Sandbox Code Playgroud)
没有运气。
我还将其添加到我的 Somewhere.Test.csproj 中:
<NoWarn>CS7035;7035</NoWarn>
Run Code Online (Sandbox Code Playgroud)
由于我不控制这个第三方库,因此在一个干净的解决方案中观看此警告相当令人沮丧。
我怎样才能仅仅为了这个假组件而抑制它呢?
我已经成功地抑制了这个警告
<NoWarn>7035</NoWarn>
Run Code Online (Sandbox Code Playgroud)
但在我的项目文件中。我需要将其添加到所有可能的配置和平台选择中。我有两个,所以我最终得到:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>7035</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>7035</NoWarn>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助
| 归档时间: |
|
| 查看次数: |
10726 次 |
| 最近记录: |