Reputation: 3
My C# dll has an embedded Javascript file. In the header of this file I want to include the version information. Is it posible to insert in the DLL AssemblyInfo (e.g. dll version) in the JS file?
Upvotes: 0
Views: 157
Reputation: 6030
Maybe you could use the T4 templating engine in a way similar to this.
This will e.g. translate a someFile.tt
to someFile.js
:
<#@ output extension=".js" encoding="utf-8" #>
// This file was created at <#= DateTime.Now #>
// It's version is <#= System.Reflection.Assembly.GetExecutingAssembly().GetName().Version #>
function foo() {
console.log("bar");
}
Unfortunately this snippet won't do the trick for you. It has at least two flaws:
AssemblyInfo.cs
and read the version from there.So although this advice won't be perfect it may give you a starting point.
Upvotes: 0
Reputation: 1482
Without your code i can't tell what you do with that JS file but here's an idea:
Upvotes: 1