-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix DotNetCoreCLIV2 not being able to restore custom MsBuild SDKs. #10567
Fix DotNetCoreCLIV2 not being able to restore custom MsBuild SDKs. #10567
Conversation
Thanks for the PR @Daniel-Khodabakhsh. I'd like someone on my team that's more recently familiar with the task than I am to take a look. I know that we've historically tried to keep generated nuget files out of the source dir due to potential security concerns whenever possible, but since this is within the dotnet restore task itself and cleaned up in a finally block it might be ok. I also want to check if there's a reason (besides just not having been implemented) why we don't use the credential provider here. |
Glad I can help @zarenner! |
I was suggesting that using the credential provider instead of generating temporary nuget.configs might be an alternative possible fix/workaround. My understanding is that
I'm still working through @jcagme's issue with him to see if there is an issue with using the credential provider with MSBuild SDK packages. I don't think there is, but we're still figuring out his issue. |
I don't know if using the credential provider is a good idea. |
The way it works with the nuget restore task is that you will be able to set the package sources needed in the nuget.config file. Then you set PATs for each endpoint, and instead of creating a temp nuget.config with the creds, the task will use the cred provider. This is likely the approach we would take with the dotnet task as well if we decide to switch to the cred provider. In my opinion it would be a good idea to start using the cred provider in the dotnet tasks, because the creation of the temp nuget.config has caused some issues in the past for some people. |
How long will it take to switch to using the credential provider? |
@Daniel-Khodabakhsh your changes look fine, it's odd that the PR build is failing after your merge with master. I'll take a closer look at the failures on Monday. |
I resolved the failing build issue, so I think you'll just need to merge and adjust the versions again (sorry about that!) In case you missed it, there's a little helper script for updating the versions in common/packaging-common |
Fix for issue #10498 where MsBuild SDKs cannot be restored properly because of a NuGet/dotnet issue where a passed config file is not being used for this part of the restore.
This fix copies over the generated nuget file into the source root before the restore command is used, then deletes it.
Any existing nuget.config files (case sensitive) are backed up and restored after the process.
Tested this with my own custom extension, as well as locally.