-
Notifications
You must be signed in to change notification settings - Fork 252
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
dotnet-restore should accept --configuration #5421
Comments
I disagree here. I think that your restore should not really be conditioned on any msbuild properties. I can see you needing to specify nuget config, like NuGet.Config or additional package sources. But everything else, should be restored by default in your project. If you depend on properties to be passed, this won't work in VS, for instance, where you can not pass any of these values to restore there. cc @nguerrera @emgarten @rrelyea since we were talking about this this week. |
Actually it works rather well in VS2017, if you don't mind restarting the solution. But that's besides the point, this is an extremely powerful feature in CI/CD workflows. Properties are an intrinsic part of MSBuild and therefore /t:restore happily abides. All I'm asking for is for this to be exposed in dotnet-restore, but maybe I'm missing the point and it is going to be a complicated issue :)
Sorry but I disagree, we can't dictate what one can do with MSBuild in csproj. This is an interesting article that reads:
|
Consider that the assets file, unlike most other artifacts, has the same location between configurations. This means a high risk of crossing the wires between debug and release if the assets file changes between them. That article should be updated to not encourage switching assets based on configuration IMHO.
You can pass /p:Configuration if you want and understand the risks. The only question is whether we encourage it or not via shorthand syntax and I don't think that we should. It would give the impression that you must re-restore when switching configurations, which is not the common case. |
What do you mean by assets file? |
|
Duplicate of #5895. As indicated in that issue.
To work with other conditions you will need to handle them yourself by passing the extra property values to restore, and ensuring that restore is done appropriately before each build. |
From @anoordende on June 15, 2017 23:45
Steps to reproduce
Build a project that selects packages based on configuration:
Expected behavior
When using dotnet restore with --configuration specified, it restores the correct package, especially now MSBuild does support this (and so does VS2017)
Actual behavior
It doesn't, because the --configuration flag cannot be specified.
Environment data
Copied from original issue: dotnet/cli#6894
The text was updated successfully, but these errors were encountered: