Description
openedon Mar 2, 2023
NuGet's static graph-based restore is using the ProjectInstance.FromFile()
method to create an instance of a ProjectInstance
. However, there is no way to specify the Interactive
flag in any public constructor. internal
and private
constructors derive this flag from the BuildParameters
but there is no public constructor that accepts a BuildParameters
object either.
This leads to static graph-restore not being able to set the Interactive
flag so then restores can fail in certain cases when the configured credential provider needs to prompt the user for authentication.
I think the ProjectOptions
class should just have a Interactive
property which gets plumbed through.
Repro steps:
- Have a set of projects that reference NuGet-based MSBuild project SDKs and package references
- Configure a feed that requires authentication (like Azure DevOps Artifacts)
- Configure a credential provider that will get an authentication token via a prompt (like the Azure Artifacts Credential Provider)
- Enable static graph-based restores via
/p:RestoreUseStaticGraphEvaluation=true
- Restore
This has been a problem for a few years but only recently did I have enough time to figure out why.
/cc @dfederm