You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an MSBuild project SDK is being resolved in some cases (ie Visual Studio), the SdkResolverContext has an empty string for the solution path. The MSBuildSdkResolver tries to call Path.GetDirectoryName() on an empty string and an ArgumentException is thrown. The code is trying to fall back to using the project path but is only checking for null, not an empty string.
jeffkl
changed the title
MSBuildSdkResolver throws ArgumentNullException when solution path is an empty string
MSBuildSdkResolver throws ArgumentException when solution path is an empty string
Mar 10, 2022
Describe the bug
Reported as part of dotnet/msbuild#7453
When an MSBuild project SDK is being resolved in some cases (ie Visual Studio), the
SdkResolverContext
has an empty string for the solution path. The MSBuildSdkResolver tries to callPath.GetDirectoryName()
on an empty string and anArgumentException
is thrown. The code is trying to fall back to using the project path but is only checking fornull
, not an empty string.sdk/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/MSBuildSdkResolver.cs
Line 91 in b69e8f5
To Reproduce
Evalute an MSBuild project file with a solution path as an empty string.
Exceptions (if any)
Further technical details
dotnet --info
The text was updated successfully, but these errors were encountered: