Closed jrydow closed 1 year ago
I'm afraid I don't know what targets the MVC scaffolding are calling on why it would need (or even fail) the generated file. Could use help here.
@jrydow I'm having the same problem with VS2019 and with aspnet-codegenerator 😢 Did you find a solution?
Doesn't look like there's anything actionable here. I tried with nothing but some other source generator based packages (any from ThisAssembly.* for example) and they also fail the same way. Looks like the way the scaffolding is using roslyn to build the project during scaffold doesn't properly support packages or analyzers or both. I've scanned many such issues all over. Seems to be a very brittle feature on the ASP.NET MVC side :(
When using the following code in .net core 3 mvc web project the scaffolding of views fails.
When trying to scaffold a view via add->View I get this:
If I remove the {ThisAssembly.Git.Sha} I have no problem scaffolding a view.
Steps to reproduce in VS 2019:
Details
, Template:Details
Model class:CustomerViewModel
-> Click Add After a while a dialog shows up saying 'Could not get the reflrction type for Model : CustomerViewModel'. The Output window gives the following information:Modifying the line in HomeController to this:
and try to scaffold again (redo point 7 and 8 above) and the scaffolding does produce what it is supposed to. This means that using ThisAssembly.Git.Sha breaks the scaffolding of views.