You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: source heavily modified, line numbers do not match. It took me 3w to pull this thing apart and put it back together in a somewhat useful form (including to get any stack trace at all).
fail: Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand[813862114]
Code generation failed!
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
---> System.NullReferenceException: Object reference not set to an instance of an object.
at Razor.Template.ExecuteAsync()
at Microsoft.VisualStudio.Web.CodeGeneration.Templating.RazorTemplateBase.ExecuteTemplate() in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.Templating/RazorTemplateBase.cs:line 36
at Microsoft.VisualStudio.Web.CodeGeneration.Templating.RazorTemplating.RunTemplateAsync(String content, Object templateModel) in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.Templating/RazorTemplating.cs:line 158
at Microsoft.VisualStudio.Web.CodeGeneration.CodeGeneratorActionsService.AddFileFromTemplateAsync(String outputPath, String templateName, IEnumerable`1 templateFolders, Object templateModel) in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.Core/CodeGeneratorActionsService.cs:line 118
at Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Razor.RazorPageScaffolderBase.GenerateView(RazorPageGeneratorModel razorGeneratorModel, ModelTypeAndContextModel modelTypeAndContextModel, String outputPath) in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.Mvc/RazorPage/RazorPageScaffolderBase.cs:line 269
at Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Razor.EmptyRazorPageScaffolder.GenerateCode(RazorPageGeneratorModel razorGeneratorModel) in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.Mvc/RazorPage/EmptyRazorPageScaffolder.cs:line 58
at Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Razor.RazorPageGenerator.GenerateCode(RazorPageGeneratorModel razorPageGeneratorModel) in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.Mvc/RazorPage/RazorPageGenerator.cs:line 74
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.<BuildCommandLine>b__8_0() in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.Core/ActionInvoker.cs:line 105
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args) in /home/dell/.nuget/packages/microsoft.extensions.commandlineutils.sources/6.0.0-preview.3.21166.3/contentFiles/cs/netstandard1.0/CommandLine/CommandLineApplication.cs:line 374
at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.Execute() in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.Core/ActionInvoker.cs:line 54
at Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute() in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG/CodeGenCommand.cs:line 93
File a bug
When there is no database context defined and the selected template is List, the Razor generator fails with a null pointer exception in unknown code.
Include your code
Include stack traces
Note: source heavily modified, line numbers do not match. It took me 3w to pull this thing apart and put it back together in a somewhat useful form (including to get any stack trace at all).
Include provider and version information
The text was updated successfully, but these errors were encountered: