System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DotNet.Scaffolding.Shared'
- Dominant language
- C#
- Stars
- 818
- Forks
- 260
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 10
Description
trying to scaffold CRUD pages for an entity (command below)
The DbContext as well as the entity are part of a class library.
```Package manager
dotnet aspnet-codegenerator razorpage -m Customer -dc AppDbContext -udl -outDir Pages/Customers
```
(dotnet-aspnet-codegenerator.exe 8.0.6 (8.0.624.50704))
### exception
```
dotnet : Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DotNet.Scaffolding.Shared,
Version=8.0.6.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
At line:1 char:1
+ dotnet aspnet-codegenerator razorpage -m Customer -dc AppDbContext -u ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Unhandled excep...file specified.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
File name: 'Microsoft.DotNet.Scaffolding.Shared, Version=8.0.6.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at Microsoft.VisualStudio.Web.CodeGeneration.Design.Program.Main(String[] args)
```
The library is in this path
.dotnet\tools\.store\dotnet-aspnet-codegenerator\8.0.6\dotnet-aspnet-codegenerator\8.0.6\tools\net8.0\any\Microsoft.DotNet.Scaffolding.Shared.dll
### version information
Target framework: (e.g. .NET 8.0)
Operating system: Windows 10
IDE: (e.g. Visual Studio 2022 17.11.5)
Any clues ?
Contributor guide
Assessment
This issue has not been assessed yet.