Turn off warning CS1607

后端 未结 2 682
余生分开走
余生分开走 2021-01-13 09:57

I have a common assembly file where I have tried to turn off a warning:

warning CS1607: Assembly generation -- The version \'2.0.4.121106\' specified

相关标签:
2条回答
  • 2021-01-13 10:18

    The reason why you are getting the error is because the revision number is greater than 65534. And I found researching the same problem for my solution is that there is no way (or easy/correct) to suppress this warning. But in order for us to get around it we found that we could set the following code in out AssemblyVersion.cs with your versions as an example:

    [assembly: AssemblyFileVersion("2.0.0.0")]
    [assembly: AssemblyInformationalVersion("2.0.4.121106")]
    

    This will make it the Product Version of our dlls "2.0.4.121106" when viewing the details of the Properties > Details of our dlls.

    0 讨论(0)
  • 2021-01-13 10:30

    You can do it in project properties on "Build" tab. There is a field called "Suppress warnings" where you should put "1607" there.

    0 讨论(0)
提交回复
热议问题