-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSBuildWorkspace: Unable to build hello world .netstandard2.0 class library anymore #52293
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
@ceztko If you run |
@JoeRobich Yes, it does. I updated the layout of the test project so you can run |
Switching the library from |
@ceztko MSBuildWorkspace is just an API that ships as a nuget package I do not understand what porting it to 16.9 would mean |
@jmarolf ah, sorry. I read "Milestone 16.10" above and I thought the fix was related to some infrastructure package that is usually deployed together with VS (for example this is the case for msbuild). Ok, I will just wait for the next refresh of Microsoft.CodeAnalysis.* packages. |
Since the fix for this issue was delayed multiple times, is there a realistic milestone now? |
@ceztko I tried your example and reproduced your issue. I then ran I believe this PR #61391 would help resolve your issue as you could additionally request a restore when you are loading the project into the workspace. |
@JoeRobich thanks, I hope the PR gets merged soon, and that there are no conflict of responsibility for the handling of this issue. Also, may I suggest to put the compilation of few simple projects (such as the ones I attached here) with MSBuildWorkspace under unit testing? I noticed such use case to be quite fragile and breaking easily, the last one in #58286 / microsoft/MSBuildLocator#176 which you are also following. |
Any update on this issue? Was the reload/restore API introduced eventually? |
NOTE: I'm duplicating the issue from MSBuild tracker since I noticed the actual development of
MSBuildWorkspace
happens in roslyn repository.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 [UPDATE: Improved layout of the project]
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
Microsoft.CodeAnalysis.*Workspaces* 3.9
Microsoft.Build.Locator 1.4.1
VisualStudio 16.9.2
.NET SDK 5.0.201
msbuild 16.9.0.11203
The text was updated successfully, but these errors were encountered: