Powershell Tools 1.1.0-preview4 fails when target >=net452
See original GitHub issueSteps to reproduce
- Create a Web API site.
- In project.json, set ‘frameworks’ to just ‘net462’ and update all packages to version ‘1.1.0’
"dependencies": {
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Routing": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.Logging": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.Extensions.Logging.Debug": "1.1.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final"
},
"frameworks": {
"net462": {}
},
...
- Create a new .NET Core library.
- In project.json, set ‘frameworks’ to just ‘net462’ and install EFCore 1.1 and Tools
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.EntityFrameworkCore.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final"
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final"
},
"frameworks": {
"net462": {}
}
}
- Add a reference in web api project to the library.
- In Package Manager, set the project to the library and try the Scaffold-Db command
Scaffold-DbContext -Connection "server=<server>;Database=<dbname>;Integrated Security=true" Microsoft.EntityFrameworkCore.SqlServer -Verbose
The issue
Code is not generated and the error shown is:
Build started...
Build succeeded.
Could not find assembly '[...]\.\bin\Debug\net462\win7-x64\<libraryname>.exe'.
Further technical details
EF Core version: 1.1 Operating system: Windows 10 14393.447 Visual Studio version: VS2015 Update 3 14.0.25431.01 NuGet Package Manager: 3.5.0.1996 (beta)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
When PowerShellGet v1 fails to install the NuGet Provider
This bug occurs when you try to to use a PowerShellGet cmdlet that is dependent on PackageManagement, including cmdlets such as Find-Module, ...
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 Free
Top 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
Thank you @micdenny and @rowanmiller for all the workarounds. I’ve been able to scaffold the database using
1.0.0-preview3-final
using the-StartupProject
option.Closing as we have a workaround… these issues are being resolved in future releases of the tools.