The wide lattice solution configuration is stored in scaffolding.config , which is located in the same folder with the solution file.
At the stage of installing MvcScaffolding , the init.ps script package is init.ps (you can find it in the <packages folder>\MvcScaffolding.<version>\tools directory). The script calculates aspx , cshtml and vbhtml views, and based on these numbers it is determined which kind of scaffolder will be used. Here is a snippet of this logic:
function InferPreferredViewEngine() { # Assume you want Razor except if you already have some ASPX views and no Razor ones if ((CountSolutionFilesByExtension aspx) -eq 0) { return "razor" } if (((CountSolutionFilesByExtension cshtml) -gt 0) -or ((CountSolutionFilesByExtension vbhtml) -gt 0)) { return "razor" } return "aspx" } # Infer which view engine you're using based on the files in your project $viewScaffolder = if ([string](InferPreferredViewEngine) -eq 'aspx') { "MvcScaffolding.AspxView" } else { "MvcScaffolding.RazorView" } Set-DefaultScaffolder -Name View -Scaffolder $viewScaffolder -SolutionWide -DoNotOverwriteExistingSetting
So, you can switch the scaffolder view using the following commands:
Set-DefaultScaffolder -Name View -Scaffolder "MvcScaffolding.RazorView" -SolutionWide Set-DefaultScaffolder -Name View -Scaffolder "MvcScaffolding.AspxView" -SolutionWide
Or you can manually edit the scaffolding.config file and replace the value for the ScaffolderName attribute in the tag:
<Default DefaultName="View" ScaffolderName="put here either MvcScaffolding.RazorView or MvcScaffolding.AspxView" />
source share