You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.IO.FileNotFoundException
HResult=0x80070002
Сообщение = Could not load file or assembly 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The specified file cannot be found..
Источник = CodeAnalysisProjectsAnws03.My.NET70
using Microsoft.Build.Construction;using Microsoft.Build.Evaluation;using Microsoft.Build.Locator;using Microsoft.CodeAnalysis.MSBuild;publicstaticclassProjectAnalysisService{publicstaticList<Project>GetProjects(stringsolutionPath){// Используйте MSBuildLocator для регистрации версии MSBuild
MSBuildLocator.RegisterDefaults();// using var collection = new ProjectCollection();usingvarworkspace= MSBuildWorkspace.Create();varsolution= SolutionFile.Parse(solutionPath);varsolutionProjects= solution.ProjectsInOrder
.Select(project => workspace.OpenProjectAsync(project.AbsolutePath).Result).Cast<Microsoft.Build.Evaluation.Project>()// Добавьте эту строку.ToList();returnsolutionProjects;}}
Issue Description
The full text of the error
Steps to Reproduce
Project https://github.com/jhon65496/CodeAnalysisProjects.NET7
Steps to Reproduce:
Test1();
.The error is located
The error is located in the line
Test1();
.Program.cs
ProjectAnalysisService.cs
CodeAnalysisProjects.NET7.csproj
Expected Behavior
Working without error
Actual Behavior
Working with an error
Analysis
dfgdfgdfg
Versions & Configurations
I use:
- Win10x64;
- NET-7;
- Console;
- Microsoft Visual Studio Community 2022 (64-bit version) - Current
Version 17.5.3;
The text was updated successfully, but these errors were encountered: