Assembly version

  • Thread starter Mats-Lennart Hansson
  • Start date
M

Mats-Lennart Hansson

I have a solution with many projects in. When I make a new build, I want to
change the assembly version for all projects. Is there a good way to use,
for instance, a constant so I don't need to change the assemblyversion for
each project?

Thanks,

Mats-Lennart
 
M

Marc Jennings

We use a CommonAssemblyInfo.cs file to do this.

1. Create the file in a folder called "Common", or whatever you like.
2. Copy the AssemblyVersion attribute from one of your assemblyinfo.cs
files
3. In each project, click "Add > Existing item"
4. Browse to the location of your commonassemblyinfo.cs file.
5. **DON'T* click "Open" Click on the arrow next to open and select
"Link File"
6. Edit all your assemblyinfo.cs files to remove the version
attribute.
7. Rebuild the solution. All should now have the same version number,
as defined in a single file.

Of course, you could let VS deal with the versioning automatically,
but this way gives you complete control over version numbers.


BTW, sorry this was a rushed answer. Lots to do, and too llittle
time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top