"There Was an Error Running the Selected Code Generator" in VS 2013 Scaffolding

There was an error running the selected code generator in VS 2013 scaffolding

Problem was with a corrupted web.config and package directory.

I created the new project, and copied my code files over to the new working project, I later went back and ran diffs on the config files and a folder diff on the project itself.

The problem was that the updates had highly junked up my config file with lots of update artifacts that I ended up clearing out.

The second problem was that the old project also kept hanging onto older DLLs that were supposed to be wiped with the application of the Nuget package. So I wiped the obj and bin folders, then the package folder. After that was done, I was able to get the older project repaired and building cleanly.

I have not looked into why the config file or the package folder was so borked, but I'm assuming it is one of two things.

  1. Possibly the nuget package has a flaw
  2. The TFS source control blocked nuget from properly updating the various dependencies.

Since then, before applying any updates, I check out everything. However, since I have not updated EF in a while, I no evidence that this has resolved my EF or scaffolding issue.

There was an error running the selected code generator: 'Scaffolding failed. The path is empty. (Parameter 'path')' in VS 2022

When I was recreating the solution from scratch I found the culprit. ME!

I do not like the new style of Main entry points where the code just starts without a namespace or class definition such as follows:

namespace MyNamespace
{
public static class MyClass
{
public static void Main(string[] args)
{
}
}
}

So I rewrote the class Program and created Startup and attempted to refactor all the code from Program. Obviously I did not do well. This caused my problem with the failed add of a templated Razor view.

There was an error running the selected code generator in VS 2017 scaffolding

After wasting days on that problem, I found that "K9 internet protection application" caused the problem! once I uninstalled it, the error disappeared.

Web Api Scaffolding - Error running the selected code generator

Solution / problem found.

I am using Panda Antivirus - During this entire process, i have frequently checked to see if Panda reports any blocked files, threads or any threats to the system. and it didnt report anything - so i ruled out the antivirus to be the issue.

After reading another post regarding a different issue, i noticed that one of the solutions was to deactivate the antivirus, and run a repair.
After trying everything else, i did just this.

And its working again. Finally. after ~ 20 days.

There doesnt seem to be a need to repair the installation, as activating the antivirus again, will produce the issue the next time you try to run the scaffolder.

Disabling the process monitor doesnt solve the issue, and adding all the folders to the exceptions folder of the AV would be way to much up-keep, so i will probably switch out my AV.

Hope this helps anyone else thats having this issue.

A big thanks to @oleg for trying to help me out here!

MVC scaffolding Error running selected code generator (Microsoft.AspNet.Identity.Core.dll denied)

Try to update the NuGet package for the Microsoft.AspNet.Identity.Core
You can do this for example from the Package Manger Console by typing

update-package Microsoft.AspNet.Identity.Core


Related Topics



Leave a reply



Submit