Bundle build error NETSDK1045
with incorrect SDK when the .NET SDK is fixed with global.json
#25622
Labels
area-tools
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Milestone
File a bug
If you constrain a directory to use .NET 6, but your root is using .NET 5 (using
global.json
files), then the bundle compilation fails withNETSDK1045
because it runs under a temp directory using .NET 5.Include your code
Any migrations code will do.
Include stack traces
This is from running:
The result with error is this:
Include provider and version information
EF Core version:
dotnet-ef:
6.0.0-preview.7.21378.4
Same for
Microsoft.EntityFrameworkCore.Design
andMicrosoft.EntityFrameworkCore.SqlServer
.Database provider:
Microsoft.EntityFrameworkCore.SqlServer
Target framework:
6.0.100-preview.7.21379.14
Operating system:
Microsoft Windows [Version 10.0.19043.1165]
IDE: Visual Studio 2022 Preview 3.1
Workaround
I copied this global.json to
$env:TEMP
, which is where I noticed the bundle was being compiled:After that it worked fine.
The text was updated successfully, but these errors were encountered: