-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
NuGetFallbackFolder not used for multitargeting projects #1389
Comments
@emgarten I don't think NuGet participates in the inner-loop right? I will have to think about how to enable this scenario if that's the case. Because if the app targets, say, netcoreapp1.1 and netcoreapp2.0, we need one part to be from the fallback folder and the other from the package source, which I don't think is possible today. We can enable the fallback folder if any 2.0 TFM is present, but that may break 1.x apps, if you are multi-tfming with it. Though, to be fair, I am not sure how common that is. I guess for tools that might make sense. |
Sources and Fallback Folders are evaluated in the outer build since these are applied to the entire project and cannot be on a per framework basis. Is it possible for the SDK to set these in the outer build? From the NuGet side this could be fixed by reading these properties during the inner build, and then taking the super set of all |
After thinking some more about it, I am inclined to go with your suggestion above. I mean, we would pretty much have to do a similar evaluation ourselves in the outer loop to find all the TFMs and then set a property if any 1.x TFM exists, or even do what you are suggestion ourselves in the outerloop. Since you are already doing the inner loop evaluations, I think this might be the easier fix. |
We should be able to do this in the SDK as well, if you think that makes more sense, though. |
The SDK adds the NuGetFallbackFolder for restore operations on .NET Core and .NET Standard projects so that the
BundledNETCoreAppPackageVersion
version of Microsoft.NETCore.App is always available and aligns with the CLI installer. However, the SDK fails to add the fallback folder in multitargeting projects.sdk/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.BeforeCommon.targets
Lines 91 to 95 in cd25d6b
Repro
Expected
Fallback folder is used, just as it would be for single-tfm projects
Actual
Details
dotnet --version: 2.0.0-preview3-006670
For comparison, look at the restore dependency graph generated with multi tfms vs a single tfm.
dg.singletfm.json will contain this, but dg.multitfm.json won't.
cc @emgarten
The text was updated successfully, but these errors were encountered: