Hi,
I am trying to write an add in that increments the AssemblyFileVersion Every time an assembly is built. I have done this, however I have hit a snag. Setting this vaule causes the Assembly to be rebuilt even though nothing else has has changed - How do I stop this.
Here is my increament code
private void buildEvents_OnBuildProjConfigBegin(string projectName, string projectConfig, string platform, string solutionConfig)
{
if (m_vsBuildAction == vsBuildAction.vsBuildActionClean){
return;}
Project project = m_applicationObject.Solution.Projects.Item(projectName); Debug.WriteLine(projectName); if (project.Kind == PrjKind.prjKindCSharpProject){
Property fileVersionproperty = project.Properties.Item("AssemblyFileVersion"); string[] fileVersionParts = fileVersionproperty.Value.ToString().Split('.'); int buildNumber = Convert.ToInt32(fileVersionParts[3]) + 1;fileVersionproperty.Value =
string.Format("{0}.{1}.{2}.{3}", fileVersionParts[0], fileVersionParts[1], fileVersionParts[2], buildNumber);}
}