Hi,
I've setup an empty MVC project and RazorGenerator (2.0.1) and RazorGenerator (1.5.3.0) as explained in http://www.dzone.com/links/r/precompiling_razor_views_in_aspnet_mvc_3.html.
(in short: add packages and add build targets and then voila)
It works fine except when I put a simple helper to App_Code like this
``` CS
@helper FailMiserably()
{
var ctx = Context;
}
```
It gives "The name 'Context' does not exists in the current context". It works fine if I turn RazorGenerator off.
I've also tried
``` CS
@* Generator: MvcHelper *@
```
but does not solve the problem.
I looked at the generated cs code in `obj\CodeGen\App_Code`. I saw that helper class `MyHelper` does not inherit from `HelperPage` class. Is this normal?
I've setup an empty MVC project and RazorGenerator (2.0.1) and RazorGenerator (1.5.3.0) as explained in http://www.dzone.com/links/r/precompiling_razor_views_in_aspnet_mvc_3.html.
(in short: add packages and add build targets and then voila)
It works fine except when I put a simple helper to App_Code like this
``` CS
@helper FailMiserably()
{
var ctx = Context;
}
```
It gives "The name 'Context' does not exists in the current context". It works fine if I turn RazorGenerator off.
I've also tried
``` CS
@* Generator: MvcHelper *@
```
but does not solve the problem.
I looked at the generated cs code in `obj\CodeGen\App_Code`. I saw that helper class `MyHelper` does not inherit from `HelperPage` class. Is this normal?