PDA

View Full Version : Increment Certain Projects


jnapier
02-13-2004, 02:49 PM
Im using the make vs.net solution and I want increment the version of all the projects in the solution except for one. How can I acheive this?

kinook
02-16-2004, 06:08 AM
"For managed projects containing an AssemblyInfo file (Managed C++ .NET, Visual C# and VB.NET projects), the AssemblyFileVersion (file version), AssemblyInformationalVersion (product version), and/or AssemblyVersion attributes in the project's AssemblyInfo file are created or updated."

So if you rename the AssemblyInfo.* file in the project you don't want versions to be incremented on (i.e. AssemblyInfox.*), the action will not update its version fields.

jnapier
02-16-2004, 01:41 PM
The thing is that I need a fixed version for this particular project. The project is for some server controls and they must have a fixed version so that client side scripts can be accessed correctly. So how should I go about accomplishing that when the build script runs?

The build action builds the solution,then increments the version, then builds again. I don't see where I can possibly slip the assemblyversion.cs file back into the mix.

kinook
02-16-2004, 01:57 PM
Permanently rename the AssemblyInfo.cs file for the project whose version should not be changed. With the solution open in the IDE, right-click that project's AssemblyInfo.cs file and Rename.

jnapier
02-16-2004, 02:41 PM
I know how to rename a file in vs.net. Thanks for the tutorial though. The problem with permanently renaming the AssemblyInfo.cs file is that when the solution is built, that particular assembly now has a version of 0.0.0.0.

I need to have an assemblyInfo file so that I can insure that the assembly has a fixed version such as 1.0.0.0. By renaming the file, I can no longer make sure that the project has the proper version number.

Do you need more information about the problem I am facing?

kinook
02-16-2004, 03:16 PM
VS.NET doesn't care what filename a project's assembly attributes are found in, so I'm not sure why your compiled assembly's version attribute doesn't match the project's version attribute after renaming the AssemblyInfo file.

I did a quick test here:

1) Created a new C# WinForms app in VS.NET 2003
2) Renamed the project's AssemblyInfo.cs file to AssemblyInfox.cs
3) Changed the AssemblyVersion attribute to 1.4.3.2
4) Added an AssemblyFileVersionAttribute attribute and set to 1.2.3.4
5) Built the project

Looking at the compiled executable's File version info resource (either in Explorer or a resource editor), it has the expected version of 1.2.3.4

Looking at the compiled executable's manifest in ILDASM, it has an assembly version of 1.4.3.2.

Do you get different results with a similar test, or am I missing something?