关闭警告 CS1607

编程入门 行业动态 更新时间:2024-10-27 01:22:32
本文介绍了关闭警告 CS1607的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个通用程序集文件,我试图在其中关闭警告:

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

本文发布于:2023-10-16 06:09:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1496717.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!