1

I have a web application that we publish and provide for users to install and run on their local network. They choose whether they run it as an internet, or intranet application.

When we publish the application we label the folder with the publish date (e.g. 20140815) so we know which version they have. However, when they contact support, it is a pain for them to get on the server to see the folder information.

I want to add an appsetting for cloudVersion and display it on the license page so they can easily provide it from wherever if needed. Also, they feel better seeing the version increase so they know they are getting value with the service contract.

<add key="cloudVersion" value="20140815"/>

I would like to automate the version in the appsettings. I was hoping I could use a Web.Config transform to set it with a dynamic yyyymmdd, but can't see how to do that and have found nothing in my web search.

<appSettings>
    <add key="cloudVersion" value="GETDATE()" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
</appSettings>

Is this possible? If so, how? If not, is there a better approach to achieve the same result?

davids
  • 5,397
  • 12
  • 57
  • 94
  • It's not possible. I recommend you store it into a ascii or utf8 crypted file. – Marco Alves Aug 15 '14 at 16:26
  • Why not use the publish mechanism and use a revision number instead of the date? Publish will increment the build number for you. http://msdn.microsoft.com/en-us/library/e6y518tc.aspx, http://stackoverflow.com/questions/826777/how-to-have-an-auto-incrementing-version-number-visual-studio – xDaevax Aug 18 '14 at 15:41

1 Answers1

0

Short of finding a great solution for this, I have elected for the following:

After publication, I run a bat file that does the following:

  1. copy the published directory and rename with today's date
  2. update the Web.Config appSetting value
  3. compress the updated directory using 7zip
  4. upload the compressed directory to Google Drive so my support team can provide it to our users.

You can see how I modified the string here:

bat file to modify web.config setting

Community
  • 1
  • 1
davids
  • 5,397
  • 12
  • 57
  • 94