Quantcast
Channel: RazorGenerator Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 525

Commented Unassigned: @helper - wrong class name [171]

$
0
0
I have a razor helper in App_Code/MyHelpers.cshtml

The generated class name in obj/CodeGen is
`public class _App_Code_MyHelpers_cshtml`

And of course all my views throw compile errors when referencing "MyHelpers.Something"

Adding `@* GeneratePrettyNames : true *@` does not fix the issue because then the generated __namespace__ "ProjectName.App_Code" becomes invisible in the view-code.

```
namespace ProjectName.App_Code
{
public class MyHelpers
}
```

Adding this namespace "ProjectName.App_Code" to View/web.config does not help (since it does not generate any "using" statement - which is another bug probably)
Comments: Only other workaround is to not use RZ on the views that need to use those helpers. But taking it out of App_Code and using RG on the helper is a far batter way to go.

Viewing all articles
Browse latest Browse all 525

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>