我有一个通用的汇编文件,其中我曾尝试关闭警告:
I have a common assembly file where I have tried to turn off a warning:
警告CS1607:汇编生成-版本为文件版本指定的 2.0.4.121106不是正常的 major.minor.build.revision格式
warning CS1607: Assembly generation -- The version '2.0.4.121106' specified for the 'file version' is not in the normal 'major.minor.build.revision' format
我已经做到了,但它不起作用:
I have done this but it isn't working:
#pragma warning disable 1607 [assembly: AssemblyVersion("2.0.*")] [assembly: AssemblyFileVersion("2.0.4.121106")] [assembly: AssemblyInformationalVersion("2.0.0.0")] #pragma warning restore 1607那么在代码中有什么方法可以做到这一点?
So is there some way to do this in the code?
推荐答案出现此错误的原因是因为修订号大于65534。我发现对我的解决方案研究相同的问题是没有办法(或很简单) /正确)以禁止显示此警告。但是为了使我们能够解决它,我们发现可以在AssemblyVersion.cs中以您的版本为示例设置以下代码:
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")]当查看属性> DLL的详细信息时,它将成为我们的dll 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.
更多推荐
关闭警告CS1607
发布评论