C# ASP.NET Visual studio Adding data to deployment files -


I am trying to add additional data to each file deploying IIS.

In particular, I need to add a version number to each deployment file during build processing or deployed / packaged files.

The only solution I can come up with so far is the pre or post build event that effectively adds a comment to every file, which is mostly in HTML, CSS, and Javascript files. , Which contains the version number.

It would be quite easy to do this, but it seems quite a hack and was wondering if anyone knows better way.

The information does not need to be a comment, metadata or any other medium, as long as the file has a version number record, it is in all cases.

The version number is generated by TeamCity and the file is placed on the file system which is used to add assemblies generated.

Thank you.

compiled assemblies for non ... hacking information in some commented information are equal.

For compiled assemblies ..... you can update the AssemblyFileVersion property.

MyRevision will have some work related to your source-control, I have commented svn version about it, your source-control (and some functions) should be able to do this. So for demo purposes, I've hard-coded a MyRevision value.

and / or (FileUpdate and SvnVersion) are tasks.

  & lt; Goal Name = "VersionTagItTarget" & gt; & Lt; ItemGroup & gt; & Lt; Include AssemblyInfoFiles = "$ (ProjectDir) \ ** \ * AssemblyInfo.cs" /> & Lt; / ItemGroup & gt; & Lt; PropertyGroup & gt; & Lt; MyRevision & gt; 999 & lt; / MyRevision & gt; & Lt; / PropertyGroup & gt; & Lt ;! - & lt; SvnVersion LocalPath = "$ (MSBuildProject Directory)" toolpath = "$ (SVNToolPath)" & gt; & Lt; Output Task Parameter = "Modification" Property Name = "Myvivision" /> & Lt; / SvnVersion & gt; - & gt; & Lt; FileUpdate Files = "@ (AssemblyInfoFiles)" Regex = "AssemblyFileVersion \ (& amp; quot; (\ d +) \. (\ D +) \. (\ D +) \. (\ D +)" Replacement Text = "Assembly file (& amp;; Quot; $ 1. $ 2. $ 3. $ (MyrVision)" />   

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -