Commit abc56b3
authored
When the SDK is installed in a path containing special characters, for e.g., under `C:\Program Files (x86)\dotnet` (the special characters here being `{'(', ')'}`), calling an MSBuild property function like `$([System.IO.Path]::GetFullPath())` on `$(MSBuildThisFileDirectory)` will result in MSBuild escaping any special characters that are returned.
Now, this is what the [documentation ](https://docs.microsoft.com/en-us/visualstudio/msbuild/property-functions?view=vs-2019)says about using property functions:
>String values returned from property functions have[ special characters](https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-special-characters?view=vs-2019) escaped. If you want the value to be treated as though it was put directly in the project file, use `$([MSBuild]::Unescape())` to unescape the special characters.
>...
>In static property functions, you can use any static method or property of these system classes:
> ```
> System.Byte
>...
> System.IO.Path
>...
> Microsoft.Build.Utilities.ToolLocationHelper
> ```
When such an escaping happens, characters like `(` get translated to`%26` etc. When `UsingTask` encounters a value of `$(PresentationBuildTasksAssembly)` containing encoded characters, it fails.
We must unescape these characters by calling `$([MSBuild]::Unescape())` to ensure that `UsingTask` will not fail.
1 parent d531fd9 commit abc56b3
File tree
1 file changed
+1
-1
lines changed- src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments