Scaffolding failed. Could not load information for project
See original GitHub issueExpand on this issue
- You won’t have this error if your project doesn’t have the “ProjectReference”
- When you add “ProjectReference” and try adding Scaffolded now you will get this error
Video:
Include stack traces
"[Trace]: Command Line: --project D:\WebProjects\ScaffoldingTest\ScaffoldingTest\ScaffoldingTest.csproj --no-build --port-number 49754 area Afa --dispatcher-version 2.0.0 --no-dispatch --simulation-mode
Scaffolding failed.
Could not load information for project D:\WebProjects\ScaffoldingTest\ScaffoldingTest.Model\ScaffoldingTest.Model.csproj
[Trace]: at Microsoft.VisualStudio.Web.CodeGeneration.Utils.RoslynWorkspaceHelper.GetProjectReferenceInformation(IEnumerable`1 projectReferenceStrings)
at Microsoft.VisualStudio.Web.CodeGeneration.Utils.RoslynWorkspace..ctor(IProjectContext projectInformation, String configuration)
at Microsoft.VisualStudio.Web.CodeGeneration.Design.CodeGenCommandExecutor.AddFrameworkServices(ServiceProvider serviceProvider, IProjectContext projectInformation)
at Microsoft.VisualStudio.Web.CodeGeneration.Design.CodeGenCommandExecutor.Execute(Action`1 simModeAction)
at Microsoft.VisualStudio.Web.CodeGeneration.Design.Program.<>c__DisplayClass4_0.<<Execute>b__0>d.MoveNext()"
Edit After I tried debugging https://github.com/dotnet/Scaffolding/blob/f9d5980105a2f1604e98a330b51a8959fe870097/src/Scaffolding/VS.Web.CG.Utils/Workspaces/RoslynWorkspaceHelper.cs#L12 I found the problem was that the project could not be obtained https://github.com/dotnet/Scaffolding/blob/f9d5980105a2f1604e98a330b51a8959fe870097/src/Scaffolding/VS.Web.CG.Utils/Workspaces/RoslynWorkspaceHelper.cs#L20
innerException:
InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk' specified could not be found.
Include provider and version information
Microsoft.VisualStudio.Web.CodeGeneration.Design version: 6.0.9 Target framework: .Net 6 Operating system: Windows 10 (21H2) IDE: Visual Studio Version 17.3.4
Edit: Found a solution (pending fix)
- Unload another project https://github.com/dotnet/Scaffolding/issues/2019#issuecomment-1250187016 or
- Make a new project, add scaffolding then copy to the main project https://github.com/dotnet/Scaffolding/issues/2019#issuecomment-1251531466
Issue Analytics
- State:
- Created a year ago
- Reactions:10
- Comments:59 (2 by maintainers)
Top Results From Across the Web
c# - Asp.net core 6 / Scaffolding failed, Could not load ...
As you can see, I only have two projects : one web app MVC (.net 6) and one class librairy. When i add...
Read more >EF razor add CRUD scaffolding: there was an error running ...
EF razor add CRUD scaffolding: there was an error running the selected code ... scaffolding failed: could not load information for project.
Read more >Scaffolding does not work for the projects with multiple ...
Scaffolding does not work for the projects with multiple target frameworks. Try to add a scaffolded item. The result is:
Read more >Scaffolding in empty ASP.NET Core projects fails when . ...
We have fixed the problem in an upcoming release. The problem is because it is not being able to add package Microsoft. VisualStudio....
Read more >How To Fix Common Errors Using ASP.NET MVC Scaffolding
Make sure to select a model and a data context class. Otherwise, the Add button of the dialog won't be enabled and you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m experiencing the same bug scaffolding identity on a multi project solution. I’m using 6.0.9 version of net core libraries.
Make new project with same solution and project name and add DB context and other necessary thing than scaffold then the new added files add in the main project you are making, now you are good to go.
On Tue, Sep 20, 2022, 01:39 Deep Choudhery @.***> wrote: