Almeans got this error once scaffolding suddenly “tright here was an error running the selected code gen...

You are watching: There was an error running the selected code generator

Sep 23, 2020 10:43 AM|Eripin|LINK
Hi, I require assist concerning scaffolding. At first I have the right to use scaffolding and also functions fine. However, yesterday I tried and can not job-related at all, it"s not only on single projects, it"s for all tasks. I remember there are lot of visual studio updays, I wondered probably that"s the problem. I tried lot of pointer I deserve to uncover in internet and also nopoint functions. I think it"s not job certain because all my projects can"t scaffold. I use postgresql and .NET Core 3.1 . Attached is screenswarm of my project dependencies. My specification : visual studio Version 16.7.4 dotnet 3.1.402



Jerry Cai


Re: Always got this error as soon as scaffolding unexpectedly “tright here was an error running the selected code...

Sep 24, 2020 06:28 AM|Jerry Cai|LINK

For the error message, it often relates to the inproper targain framework of the tasks or go to Tools -> Options -> Nuget Package Manager ->Package Manager Setting-> General ->Clear All Nugain Cache(s).

Or you have the right to try to reinstall the visual studio produce a brand-new job,then if it can work-related, I would certainly indicate you copy the code from old project to this new task.

And It will certainly not be easy for us to locate your specific trouble according to the message you readily available, simply discover some link for you, hope they have the right to help:

Best Regards,

Jerry Cai are relocating to a brand-new house on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting brand-new concerns and gain affiliated this day. Learn more >


Re: Almeans acquired this error once scaffolding suddenly “tright here was an error running the schosen code...

Sep 24, 2020 05:24 PM|Eripin|LINK
Thank you for your reply James.

See more: South Park: The Stick Of Truth Fruit Bat ? Arrpeegeez: South Park

After stuck for days, I regulate to solved it myself. My guess is latest upday for Microsoft.EntityFrameworkCore 3.1.8 (I inspect the logs it"s 16 days ago) or latest visual studio upday pressure scaffolding to use 3.1.8. Everytime scaffold using brand-new visual studio update(this is my guess) is installing 3.1.8. I check my .nuget/package in traveler and also noticed it. After that I try lot of things because I do not desire to upgrade variation. I store the version to 3.1.4 because I usage postgre and also latest variation for postgre library(Npgsql.EntityFrameworkCore.PostgreSQL) is 3.1.4(tbelow is no 3.1.8). It"s kind of annoying if library not updated together particularly when they have dependencies. However, Because scaffolding use Microsoft.EntityFrameworkCore.SqlServer even though you are not making use of sqlserver. The solution for this problem is to install latest update of Microsoft.EntityFrameworkCore.SqlServer and Microsoft.EntityFrameworkCore. I don"t understand just how this will certainly affect the code because currently I have various variation for Microsoft.EntityFrameworkCore and also Npgsql.EntityFrameworkCore.PostgreSQL.