Forum Discussion
MSB4184: The expression "[System.IO.Path]::GetDirectoryName('')" cannot be evaluate
Hi got this error now after I updated my VS IDE ....
The path is not of a legal form. WinFormsSQLExamplePro C:\Program Files\dotnet\sdk\10.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Windows.targets
<_WinRTRuntimeDllDirectory>$([System.IO.Path]::GetDirectoryName('%(_WinRTRuntimeDllReferencePath.FullPath)'))</_WinRTRuntimeDllDirectory>
<_CsWinRTOrTargetingPackLibDirectory>$([System.IO.Path]::GetDirectoryName('$(_WinRTRuntimeDllDirectory)'))</_CsWinRTOrTargetingPackLibDirectory>
Note the top most path entry contains a '%' character , whereas the 2nd path contains a '$' character...
Not sure what is going on ... (happened after VS update)
1 Reply
- Harold-PicadoBrass Contributor
Hi, It sounds like something may have changed with the SDK rather than your project itself, especially since it started immediately after updating Visual Studio.
One thing I'd check is whether the latest .NET SDK introduced a regression. You could also try clearing the bin and obj folders, repairing Visual Studio, or temporarily using an earlier SDK (if you have one installed) to see if the issue disappears.
Also, are you targeting WinForms on .NET 10, or an earlier .NET version? That might help narrow down whether it's an SDK-specific issue.