question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Powershell Tools 1.1.0-preview4 fails when target >=net452

See original GitHub issue

Steps 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
farlopcommented, Dec 1, 2016

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.

0reactions
rowanmillercommented, Dec 7, 2016

Closing as we have a workaround… these issues are being resolved in future releases of the tools.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found