Changing the Projects Version

The following code may be used in the Macro Studio. It will update the AssemblyInfo files to reflect them with a given version. When the files are required to be chacked out, it will happen automatically.

''' <summary>
''' For all projects in the solution,
''' change the version to a given version
''' </summary>
''' <remarks>some items in the solution might produce an exception
''' for istance if they are not loaded, or they have no vesion
''' </remarks>
Sub ChangeVersionProperties()
Dim sol = DTE.Solution
Dim projectT As EnvDTE.Project = sol.Projects.Item(1)
Dim newVersion As String = ""

For Each project As EnvDTE.Project In sol.Projects
" changes from ")
" to " + newVersion)
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(project.Name +
" kon niet gezet worden: " + ex.Message)
End Try
End Sub

Author: Pouya Panahy

Microsoft certified DevOps engineer with passion in analysing, designing and implementing solutions for Azure Cloud with hands-on experience in security and quality assurence.

Leave a Reply