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
//Replace with the correct filepathvarfilePath=@"C:\Users\JoshVarty\Documents\GitHub\MSBuildWorkspaceBug\MSBuildWorkspaceBug.sln";varmsbws= MSBuildWorkspace.Create();varsoln= msbws.OpenSolutionAsync(filePath).Result;foreach(var proj in soln.Projects){varname= proj.Name;varcompilation= proj.GetCompilationAsync().Result;varerrors= compilation.GetDiagnostics().Where(n => n.Severity == DiagnosticSeverity.Error).ToList();}
Observe the following four errors:
C:\Users\JoshVarty\Documents\GitHub\MSBuildWorkspaceBug\raw\RawAssemblyAttributes.cs(12,11): error CS0246: The type or namespace name 'CLSCompliantAttribute' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\JoshVarty\Documents\GitHub\MSBuildWorkspaceBug\raw\RawAssemblyAttributes.cs(12,11): error CS0246: The type or namespace name 'CLSCompliant' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\JoshVarty\Documents\GitHub\MSBuildWorkspaceBug\raw\RawAssemblyAttributes.cs(12,24): error CS0518: Predefined type 'System.Boolean' is not defined or imported
C:\Users\JoshVarty\Documents\GitHub\MSBuildWorkspaceBug\raw\RawAssemblyAttributes.cs(11,7): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
Expected Behavior:
Compiles without errors as it does within Visual Studio.
I'm assuming there are problems with the references, so I'll include the .csproj here as well:
Version Used: Microsoft.CodeAnalysis 1.2.1
Steps to Reproduce:
Expected Behavior:
Compiles without errors as it does within Visual Studio.
I'm assuming there are problems with the references, so I'll include the
.csproj
here as well:The text was updated successfully, but these errors were encountered: