As addressed in the following discussions
* https://razorgenerator.codeplex.com/discussions/471355
* https://razorgenerator.codeplex.com/discussions/278608
RazorGenerator runs into issues with EditorTemplates and DisplayTemplates where users end up having to fully qualify types in the template files for it to work correctly. The problem is with the way RazorGenerator differs in the generation of names compared to the Asp.Net build provider.
For a file named at ~\Views\Shared\Boolean.cshtml, the build provider generates file names of the format
namespace ASP {
_Page_Views_Shared_Boolean_cshtml : WebViewPage<Boolean?>
}
versus RazorGenerator's output looks like
namespace Views.Shared
{
public class Boolean : WebViewPage<Boolean?>
}
which results in the cs compiler incorrectly inferring the templated Boolean type.
Comments: Thanks for your help with this. Sorry if it turns out to be my misunderstanding. I have *only* used nuget to install RazorGenerator.Mvc which in turn installed RazorGenerator.Mvc 2.2.1 and WebActivatorEx 2.0.4. It's added the new ViewEngine to my code through App_Start and created the CodeGen folder (and after the first build, cs files of all views got generated in there).
* https://razorgenerator.codeplex.com/discussions/471355
* https://razorgenerator.codeplex.com/discussions/278608
RazorGenerator runs into issues with EditorTemplates and DisplayTemplates where users end up having to fully qualify types in the template files for it to work correctly. The problem is with the way RazorGenerator differs in the generation of names compared to the Asp.Net build provider.
For a file named at ~\Views\Shared\Boolean.cshtml, the build provider generates file names of the format
namespace ASP {
_Page_Views_Shared_Boolean_cshtml : WebViewPage<Boolean?>
}
versus RazorGenerator's output looks like
namespace Views.Shared
{
public class Boolean : WebViewPage<Boolean?>
}
which results in the cs compiler incorrectly inferring the templated Boolean type.
Comments: Thanks for your help with this. Sorry if it turns out to be my misunderstanding. I have *only* used nuget to install RazorGenerator.Mvc which in turn installed RazorGenerator.Mvc 2.2.1 and WebActivatorEx 2.0.4. It's added the new ViewEngine to my code through App_Start and created the CodeGen folder (and after the first build, cs files of all views got generated in there).