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
Using MSBuild.Locator, Workspaces.MSBuild and the Roslyn infrastructure I'm unable to compile an hello world netstandard2.0 class library. The same library compile just fine when targeting .Net framework 4.5.2. I noticed the issue after I installed Visual Studio 16.8. Some releases before the same scenario was working.
Compile and run TestMSBuildWorkspaceCompilation project. When trying to compile the netstandard2.0 project an exception should trigger and compilation errors are printed. More explanations are in the code there.
Expected Behavior
No compilation errors should the issued when compiling the project targeting netstandard2.0.
Actual Behavior
A bunch of errors are printed, as the build system is unable to load the netstandard2.0 base library when compiling the project.
TestClassLibrary\obj\Debug\netstandard2.0\.NETStandard,Version=v2.0.AssemblyAttributes.cs[82..88)), CS0400: The type or namespace name 'System' could not be found in the global namespace (are you missing an assembly reference?)
TestMSBuildWorkspaceCompilation\TestClassLibrary\obj\Debug\netstandard2.0\TestClassLibrary.AssemblyInfo.cs[421..427)), CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
TestMSBuildWorkspaceCompilation\TestClassLibrary\obj\Debug\netstandard2.0\TestClassLibrary.AssemblyInfo.cs[497..503)), CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
[...]
Analysis
I'm currently using VS 16.9.2 but the same scenario was working some releases before 16.8.
This issue seems to be more related to roslyn infrastructure (tracking issue dotnet/roslyn#52293). Feel free to close anytime if you're already sure it's not pertinent to msbuild, or I will do it myself later.
Sorry I was a little slow in getting to this, but I agree with your analysis—the GetCompilationAsync call is what's finding the errors, and MSBuild doesn't have anything to do with that. Roslyn sounds like a likely candidate.
Issue Description
Using
MSBuild.Locator
,Workspaces.MSBuild
and the Roslyn infrastructure I'm unable to compile an hello world netstandard2.0 class library. The same library compile just fine when targeting .Net framework 4.5.2. I noticed the issue after I installed Visual Studio 16.8. Some releases before the same scenario was working.Steps to Reproduce
Unpack the following test project:
TestMSBuildWorkspaceCompilation.zip
Open TestMSBuildWorkspaceCompilation.sln;
Compile and run TestMSBuildWorkspaceCompilation project. When trying to compile the netstandard2.0 project an exception should trigger and compilation errors are printed. More explanations are in the code there.
Expected Behavior
No compilation errors should the issued when compiling the project targeting netstandard2.0.
Actual Behavior
A bunch of errors are printed, as the build system is unable to load the netstandard2.0 base library when compiling the project.
Analysis
I'm currently using VS 16.9.2 but the same scenario was working some releases before 16.8.
Versions & Configurations
msbuild 16.9.0.11203
VisualStudio 16.9.2
.NET SDK 5.0.201
The text was updated successfully, but these errors were encountered: