它在C#项目的AssemblyInfo.cs中表示,可以使用*指定版本信息
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]我将其更改为:
[assembly: AssemblyVersion("1.0.*.*")]
[assembly: AssemblyFileVersion("1.0.*.*")]这是我从编译器得到的错误:
error CS0647: Error emitting 'System.Reflection.AssemblyVersionAttribute' attribute -- 'The version specified '1.0.*.*' is invalid'
warning CS1607: Assembly generation -- The version '1.0.*.*' specified for the 'file version' is not in the normal 'major.minor.build.revision' format它是如何做到的(它甚至?)它能用吗?
发布于 2012-04-19 22:17:46
[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyFileVersion("1.0.*")] 只需记住注释AssemblyFileVersion行,否则自动生成的程序集版本将始终为"1.0.0.0“。
发布于 2015-07-24 19:19:01
在我看来,使用[assembly: AssemblyVersion("x.y.z.*")],Patch不应该自动编号。例如:
程序集: AssemblyVersion("1.2.3.*")
在AssemblyVersion中使用'*‘是很好的,但遵循seemver.org,我们应该使用*作为来自版本结构<major version>.<minor version>.<build number>.<revision>的revision部分)。
在给定版本号MAJOR.MINOR.PATCH的情况下,
递增:
主要版本当您进行不兼容API更改时,
以向后兼容的方式添加功能时的次要版本,以及
进行向后兼容的错误修复时的补丁版本。
发布于 2019-03-26 08:02:35
那么,为什么提供的注释会说
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]但是构建会生成CS8357吗?有人没收到备忘录。
Work around:
1. Close all open documents
2. In the Solution Explorer, right-click the Project and select Unload Project
3. In the Solution Explorer, right-click the Project (now marked as unavailable) and select Edit to access the `.CSPROJ` file
4. In the opened window, find `<Deterministic>true</Deterministic>` and change it to `<Deterministic>false</Deterministic>`
5. Save the file and ensure that the edit window is closed
6. In the Solution Explorer, right-click the Project and select Reload Project
Your build (should then) work. :)https://stackoverflow.com/questions/10229711
复制相似问题