-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolved project and package references in some cases are faulty #8405
Comments
May related:
It is confusing to remain this bug/feature unsolved for years. |
@sanmuru - Adding
Into your Issue here is that As for the nuget resolution issue - this falls into scope of nuget - I'm filing issue with them: NuGet/Home#12436. |
@sanmuru - is there a specific reason why you force the By removing the You just need to adjust your implicit usings in this case (as the feature was tailored for net6 and onwards - see dotnet/sdk#24146). So the root Console project would look like:
|
Well, in actual case, my I want to use asynchronous programming in The IDE I use is Visual Studio latest preview. During code typing in Then I find this issue: build success but run fail with a Actualy I can do things in a better way, but the bug is still there right? |
@sanmuru Yes - issue is still present - more precisely 2 issues (project references resolution and packages references resolution). The MSBuild bug (transitive project reference resolution issue when restricting multitargeted references) has a workaround with setting The Nuget dependecies resolution behavior cannot be currently tweaked (as per NuGet/Home#12436) - so the best option is to add the needed references (conditioned) to the root project as well. Would those options help mitigate the problem in your case? |
Team triage: msbuild and sdk are pulling the relevant information from NuGet, so NuGet/Home#12436 is the correct issue to pursue for a fix. |
Issue Description
Suppose there is a
Main
project reference a multi-targetingLib
project, and to everyLib
project's target framework, there are other different projects and packages referenced byLib
. The result is build success but run fail.The dependencies that copy to local are faulty.
Steps to Reproduce
I put a similar sample in sanmuru/MSBuild-bug.
Console
(Main) project referenceCoreLib
(Lib) project withSetTargetFramework="TargetFramework=netstandard2.0"
.CoreLib
(Lib) project referenceNet462UtilLib
project andSystem.Text.Json
package when targetingnet462
.CoreLib
(Lib) project referenceNetStandard20UtilLib
project andNewtonsoft.Json
package when targetingnetstandard2.0
.Console
(Main) project do reference the correct output assembly (and its dependencies) which fromNetStandard20UtilLib
project, but as well copy output assembly fromNet462UtilLib
project andSystem.Text.Json
package instead ofNewtonsoft.Json
package to local.Expected Behavior
No idea whether it is a feature or a bug, if it is a bug then fix it, or crash build process if it is a feature.
Versions & Configurations
.NET Runtime: 7.0.200-preview.22628.1
The text was updated successfully, but these errors were encountered: