aws/porting-assistant-dotnet-client

Solution not buildable in porting-assistant 1.9.0 (but in Visual Studio 2022 and msbuild from cmd line it is buildable)

Closed this issue · 4 comments

Hi,

A solution that is buildable in VisualStudio 2022 can not be build in the porting-assistant when choosing assess a new solution.

From View Log:
[2022-11-09 11:28:25 DBG] (1.9.0) PortingAssistant.Client.Analysis.PortingAssistantAnalysisHandler: [24] Building project : C:\WEBSERVICES\TestWcfServices\TestWcfServices.csproj [2022-11-09 11:28:26 ERR] (1.9.0) PortingAssistant.Client.Analysis.PortingAssistantAnalysisHandler: Build error: Codelyzer wasn't able to retrieve the MSBuild path System.NullReferenceException: Object reference not set to an instance of an object. at Codelyzer.Analysis.Common.MSBuildDetector.<>c__DisplayClass12_0.<GetMsBuildPathFromVSDirectory>b__5(FileInfo msbuild) at System.Linq.Enumerable.WhereListIterator1.ToList()
at Codelyzer.Analysis.Common.MSBuildDetector.GetMsBuildPathFromVSDirectory(DirectoryInfo vsDirectory, List1 editions, String[] targets, String projectToolsVersion) at Codelyzer.Analysis.Common.MSBuildDetector.GetFileSystemMsBuildExePath(String programFilesPath, String programFilesX86Path, String toolsVersion) at Codelyzer.Analysis.Common.MSBuildDetector.GetFirstMatchingMsBuildFromPath(String programFilesPath, String programFilesX86Path, String toolsVersion) at Codelyzer.Analysis.Build.WorkspaceBuilderHelper.GetEnvironmentOptions(Boolean requiresNetFramework, String toolsVersion) at Codelyzer.Analysis.Common.MSBuildDetector.GetMsBuildPathFromVSDirectory(DirectoryInfo vsDirectory, List1 editions, String[] targets, String projectToolsVersion)
at Codelyzer.Analysis.Common.MSBuildDetector.GetFileSystemMsBuildExePath(String programFilesPath, String programFilesX86Path, String toolsVersion)
at Codelyzer.Analysis.Common.MSBuildDetector.GetFirstMatchingMsBuildFromPath(String programFilesPath, String programFilesX86Path, String toolsVersion)
at Codelyzer.Analysis.Build.WorkspaceBuilderHelper.GetEnvironmentOptions(Boolean requiresNetFramework, String toolsVersion)`

Screenshots

image

Desktop (please complete the following information)

  • OS: Windows 10 pro

And some relevant environment vars:
image

And msbuild is working from cmd line:
image

Also happens when using the porting-assistant-client as a nuget package

image

Fixed by reinstalling VS 2022