对于使用 Visual Studio 2019 的 ASP.Net,我创建了一个共享的 AssemblyInfo.cs 文件,然后在解决方案的每个项目中引用该文件。从而为我提供了一个位置来设置版本信息,然后为每个项目设置该版本信息。
\nusing System.Reflection;\nusing System.Runtime.InteropServices;\nusing JetBrains.Annotations;\n\n[assembly: AssemblyConfiguration("")]\n[assembly: AssemblyCompany("Company Name")]\n[assembly: AssemblyProduct("Product name")]\n[assembly: AssemblyCopyright("Copyright \xc2\xa9 Company. All Rights Reserved.")]\n[assembly: AssemblyTrademark("")]\n[assembly: AssemblyCulture("")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components. If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n[assembly: AssemblyVersion("1.15.0")]\n[assembly: AssemblyFileVersion("1.15.0.7156")]\n[assembly: AssemblyInformationalVersion("1.15.0")]\nRun Code Online (Sandbox Code Playgroud)\n每个项目都有一个简化的 AssemblyInfo.cs 文件:
\nusing System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an …Run Code Online (Sandbox Code Playgroud)