We have a webapplication which doesn't use MVC. This webapplication is already using an Assembly.cs. In my C# code I can get the version number of the webapplication, but how to get it in the webpage (.cshtml)?

I tried using


but it returns

t0cxczo0, Version=, Culture=neutral, PublicKeyToken=null

Not something which looks familiar.

When I use


It compiles fine, but at run-time I get

"Cannot find namespace MyApp"

MyApp is the name of my application and Application is one of my classes.

I also tried


But that also returns the "Cannot find namespace MyApp" error.

My webapplication uses some other home-made binaries which are reused across other webapplications. When I use


I'm getting the name and version of the other assembly that is handling the template stuff. So I'm getting close ;)

When I use


I get a "Template Execution" error

When I use


I'm getting an error about HttpContext doesn't exists.

Please advice how to do this should-be-easy task.

Related posts

Recent Viewed