I have vs 2017 and 2022 installed.
I have tried the following command from a VS 2017 and VS 2022 developer prompt. As well as from a standard powershell prompt.
I am using --vs-path to specify the path to VS 2022 install
All produce the same issue. VS 2017 is selected by the tool. The tool fails. It should be respecting my vs path flag and choosing 2022.
Error below
Microsoft .NET Upgrade Assistant v0.4.355802+b2aeae2c0e41fbfed35df6ab2e88b82a0c11be2b
[15:52:16 INF] Loaded 9 extensions
[15:52:19 INF] Using MSBuild from C:\Program Files\dotnet\sdk\6.0.102\
[15:52:19 INF] Using Visual Studio install from C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional [v15]
[15:52:24 INF] Loading upgrade progress file at C:\projects\srms-next\Common\Development\EsriCore.upgrade-assistant
[15:52:24 INF] Initializing upgrade step Back up project
[15:52:24 INF] Initializing upgrade step Convert project file to SDK style
Error
[15:59:39 INF] Applying upgrade step Convert project file to SDK style
[15:59:39 INF] Converting project file format with try-convert, version 0.4.355802+b2aeae2c0e41fbfed35df6ab2e88b82a0c11be2b
[15:59:39 ERR] Unexpected error applying step
Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Current\Microsoft.Common.props" was not found. Confirm that the expression in the Import declaration "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Current\Microsoft.Common.props" is correct, and that the file exists on disk. C:\Program Files\dotnet\sdk\6.0.102\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Current\Microsoft.Common.props does not exist. But C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Microsoft.Common.props does. Which is why i'm trying to set --vs-path.
Describe the bug
I have vs 2017 and 2022 installed. I have tried the following command from a VS 2017 and VS 2022 developer prompt. As well as from a standard powershell prompt. I am using --vs-path to specify the path to VS 2022 install All produce the same issue. VS 2017 is selected by the tool. The tool fails. It should be respecting my vs path flag and choosing 2022. Error below
upgrade-assistant upgrade C:\projects\srms-next\Common\Development\EsriCore\EsriCore.csproj --vs-path "C:\Program Files\Microsoft Visual Studio\2022\Professional"
Microsoft .NET Upgrade Assistant v0.4.355802+b2aeae2c0e41fbfed35df6ab2e88b82a0c11be2b
[15:52:16 INF] Loaded 9 extensions [15:52:19 INF] Using MSBuild from C:\Program Files\dotnet\sdk\6.0.102\ [15:52:19 INF] Using Visual Studio install from C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional [v15] [15:52:24 INF] Loading upgrade progress file at C:\projects\srms-next\Common\Development\EsriCore.upgrade-assistant [15:52:24 INF] Initializing upgrade step Back up project [15:52:24 INF] Initializing upgrade step Convert project file to SDK style
Error
[15:59:39 INF] Applying upgrade step Convert project file to SDK style [15:59:39 INF] Converting project file format with try-convert, version 0.4.355802+b2aeae2c0e41fbfed35df6ab2e88b82a0c11be2b [15:59:39 ERR] Unexpected error applying step Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Current\Microsoft.Common.props" was not found. Confirm that the expression in the Import declaration "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Current\Microsoft.Common.props" is correct, and that the file exists on disk. C:\Program Files\dotnet\sdk\6.0.102\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Current\Microsoft.Common.props does not exist. But C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Microsoft.Common.props does. Which is why i'm trying to set --vs-path.
.csproj file