Open MaceWindu opened 2 years ago
As workaround we switched to dotnet build
calls from Exec
task
I can successfully repro. Some questions:
What version of MSBuild did you update from?
Can you provide a binlog of the regressed scenario with the older version of MSBuild?
Did your version of the SDK change during this update?
cc @dplaisted does this ring any bells/seem like an SDK issue?
Yes, both SDK and MSBuild versions changed, but I made tests with older versions:
MSBUILD: Microsoft (R) Build Engine version 17.2.1+52cd2da31 for .NET Framework
From Visual Studio Build Tools 2022 17.2.6
- dotnet SDK: 6.0.302: Works
- dotnet SDK: 6.0.400: Works
binlog msbuild.17.2.1.zip
After build tools update:
MSBuild version 17.3.0+f67e3d35e for .NET Framework
From Visual Studio Build Tools 2022 17.3.1
- dotnet SDK: 6.0.400: Error
binlog msbuild.17.3.0.zip
Came across this thread whilst looking for answers....
I have a TeamCity build agent which was building perfectly fine with MS Build 17.1.0+ae57d105c but after update to MSBuild 17.3.1+2badb37d1 is now failing to build with error NETSDK1112.
Building win10-x64 app targetting .Net 6.0.
Team Triage: There's an issue with the build.msbuild
project. We noticed Targets="Restore;Build"
. Restore should happen in its own step, either by running msbuild /restore
or create some restore target that calls the Restore
target of the project you're trying to build. Let us know if it continues to fail afterward.
@oriches Can you file a separate issue with more details (logs, reproducible project)?
Well, with two separate MSBuild tasks (one for restore and one for build) it works. Does it mean it is deliberate behavior change?
@MaceWindu this was side effect of previous changes. This currently doesn't meet bar for fixing - but we are leaving this open for upvotes.
Issue Description
We have following project configuration:
TargetFrameworks=netstandard2.0
TargetFrameworks=net48;net6.0
that also reference analyzersMSBuild
task forProject2
withTargetFramework=net48
as additional propertyAfter update to 17.3 build target start to fail with following error
Steps to Reproduce
MsBuildRegression.zip
In attached sample project invoke
build-fails.cmd
to get error.build-works.cmd
will run a task withTargetFrameworks=net48
which ~will pass~ fail too.Expected Behavior
Specifying target framework for project doesn't affect target frameworks for referenced projects (or whatever happens here...)
Analysis
Versions & Configurations