Open sigma-schn opened 2 years ago
@sigma-schn this seems to be table-stakes for an XML parser & writer so I am surprised it is the cause of your failure. Can you provide a csproj (before conversion) which causes this behavior, by chance? We have migrated many csproj files and not seeing this cause a problem.
I wonder if the root of the issue is that OutputPath
is present in the file yet being unused. If you remove it from the source file, what happens? Or is there a particular reason you need it present but empty?
@brandonh-msft I can confirm that the error is caused by the OutputPath element in the csproj file being separated onto multiple lines. If you remove the line break the csproj file will load just fine in Visual Studio.
This was our project file before running the upgrade assistant:
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<OutputPath></OutputPath>
</PropertyGroup>
After running the upgrade assistant, our project file looked like this:
<PropertyGroup>
<TargetFramework>netstandard20</TargetFramework>
<OutputPath>
</OutputPath>
</PropertyGroup>
In order to load the project in Visual Studio, I had to remove the line break. I whole heartedly agree, OutputPath doesn't need to be there since it is blank, but a lot of us have solutions with hundreds of projects that have this in there as empty by default.
Anyway, just confirmation that @sigma-schn is correct in his analysis of the issue.
upgrade-assistant.clef
that is produced in the working directoryDescribe the bug
After the Upgrade of a net48 WPF project to a net6 WPF project, the closing Tags of empty Tag-Pairs that were in the original csproj-file are moved to a new line. This leads to a not-loadable csproj-file, if the OutputPath-Tag was modified. Example: Prior to upgrade:
After Upgrade:
This produces the error:
[MSB4184] Der Ausdruck "[System.IO.Path]::Combine(******, \)" kann nicht ausgewertet werden. Illegales Zeichen im Pfad. C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets at (322:5)
(Path obfuscated)
To Reproduce
Exceptions (if any)
Further technical details
Windows version and bitness info (32-bit or 64-bit) Edition Windows 11 Pro Version 21H2 Installiert am 29.10.2021 Betriebssystembuild 22000.856 Leistung Windows Feature Experience Pack 1000.22000.856.0
Include the output of
dotnet --list-sdks
3.1.423 [C:\Program Files\dotnet\sdk] 5.0.406 [C:\Program Files\dotnet\sdk] 5.0.408 [C:\Program Files\dotnet\sdk] 6.0.100 [C:\Program Files\dotnet\sdk] 6.0.109 [C:\Program Files\dotnet\sdk] 6.0.202 [C:\Program Files\dotnet\sdk] 6.0.203 [C:\Program Files\dotnet\sdk] 6.0.304 [C:\Program Files\dotnet\sdk] 6.0.400 [C:\Program Files\dotnet\sdk]Include the output of
upgrade-assistant --version
0.4.346201+71e7f6e92986df688a9ef901343b24c9ad63ccff