title: In C#.NET, how to add version number to static file references, such as HTML and CSS?
body: <p>So I'm building a web app using C#.NET, and would like to add a version number to file references. For example:</p>
  
  <pre><code>&lt;script src="mysite/scripts/default.123.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Each time I modify files in the web app, including cshtml, CSS, JS, or images, is it possible to have that version number incremented dynamically? <strong>In other words, how do I get [or create] the version number in the first place? Is it possible?</strong></p>
  
  <p>This is to avoid caching old copies on the client browsers, especially when being served via XHR. For reasons I don't want to take the time to explain, I am NOT asking for alternative methods, such as dummmy parameters, no-cache meta tags, datetimestamps, CDN's etc. </p>
  
  <p>I'd like this number to correspond to the most recent version of file that was modified - maybe "build version" isn't the right word. As Kyle Trauberman, assemblyversion might might work. However will this accomodate for changes to static resources, such as HTML or CSS? What is a good method for that?</p>