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: It would be great if you could please update the nuget packages to support this. I've run into this issue, and firstly renaming the templates with underscores might create unexpected issues elsewhere, plus even that wasn't a solution when I ran into this. I have a view called Shared \ EditorTemplates \ Specifications \ FetchCompany but also a class called FetchCompany in a different namespace that this view references. It's using the View class FetchCompany rather than the existing FetchCompany class. I know I could fully qualify the class name, but I've got over 40 errored views like this trying out RazorGenerator, I'm part of a team, and making major view changes is a bit scary. I can't be sure of the knock-on effect, particularly when it was just for evaluation. Thanks!
* 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: It would be great if you could please update the nuget packages to support this. I've run into this issue, and firstly renaming the templates with underscores might create unexpected issues elsewhere, plus even that wasn't a solution when I ran into this. I have a view called Shared \ EditorTemplates \ Specifications \ FetchCompany but also a class called FetchCompany in a different namespace that this view references. It's using the View class FetchCompany rather than the existing FetchCompany class. I know I could fully qualify the class name, but I've got over 40 errored views like this trying out RazorGenerator, I'm part of a team, and making major view changes is a bit scary. I can't be sure of the knock-on effect, particularly when it was just for evaluation. Thanks!