Jay Stevens Jay Stevens - 1 year ago 106
C# Question

Problem getting the AssemblyVersion into a web page using Razor /MVC3

I'm using the following code in a footer in my _Layout.cshtml file to put the AssemblyInfo version data into the footer of every page in my MVC3 site. However:


Just prints in the footer:


When I modified the view to display all of the assembly info for the "Executing Assembly" using the following


Which prints the following:

Revision App_Web__layout.cshtml.639c3968.hlogy75x, Version=, Culture=neutral, PublicKeyToken=null

This shows that the "Executing Assembly" isn't my main app, it's the view itself.

How do I get the assembly information for the ACTUAL app, not just the individual views??

Answer Source

cshtml/vbhtml is dynamic compile to assembly.


how about this?