Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore the CS7035 "Specified version does not conform to the recommended format" in the Fakes assembly

I use VS 2015 U1. I use an external library with a strange versioning - 1.0.4056.40164.

I added a .Fakes file for this library. When fakes assembly is built, I get the following warning:

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]

I have specified in my .Fakes file:

 <Compilation>
    <Property Name="NoWarn">CS7035,7035</Property>
    <Property Name="DisabledWarnings">7035;1607</Property>
  </Compilation>

with no luck.

I also added this to my Somewhere.Test.csproj:

  <NoWarn>CS7035;7035</NoWarn>

Since I do not control this third party library, it makes it fairly frustrating to watch this warning in an otherwise clean solution.

How can I suppress it just for this fakes assembly?

like image 502
zaitsman Avatar asked Mar 13 '23 18:03

zaitsman


1 Answers

I've successfully suppressed this warning with

<NoWarn>7035</NoWarn>

but in my project file. I needed to add it in all possible configuration and platform choices. I have two, so I ended up with:

<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>

Hope this helps

like image 172
Stephen Bethke Avatar answered May 29 '23 23:05

Stephen Bethke