Closed ddydeveloper closed 2 weeks ago
MSBuildWorkspace
and related types are .NET Framework only right now, and don't work on .NET Core.
For the 2.2. packages, you can add a <PackageReferenceFallback>
for Microsoft.Composition. That issue should be fixed in the recent 2.3 based packages though.
Isn't this basically duplicate of https://github.com/dotnet/roslyn/issues/16040 ?
The second half is, but that is only about System.Composition, not also using MSBuildWorkspace
.
@Pilchie, thanks! I supposed that MSBuildWorkspace does't work on .Net Core right now. I'll try to write same project on Net Framework 4.6.1. Is it planned to implement compatibility with .Net Core?
@nothrow yes, it is duplicate. I closed with issue and will wait 2.3 version!
@DustinCampbell can answer better than me (probably next week, as he's on vacation right now). .NET Core is tricky, since MSBuild requires running tasks, so a .NET Core app can't load projects targeting .NET Framework, since the .NET Framework tasks won't run on .NET Core.
@DustinCampbell, could you help me to understand how to work with MSBuildWorkspace from Microsoft.CodeAnalysis package if I use NET.Core 2.0 project.
I use Microsoft.CodeAnalysis 2.3.2 version and can't find Microsoft.CodeAnalysis.MSBuild workspace: "it does't exists in the current context". This problem was actual early, in 2.0 version on the package, but I expected that it must be fixed in the 2.3.*.
There is reference to the repo with the project: https://github.com/ddydeveloper/Roslyn.ApiClient.Codegen
I'll be grateful for help!
Closing out due to lack of feedback in 7 years.
I tried to use Microsoft.CodeAnalysis Workspaces s in netCore app, unfortunately i had errors.
This is my project github repository reference: https://github.com/ddydeveloper/Roslyn.ApiClient.Codegen/tree/dev/src/Roslyn.Codegen Problem in the file with path:
(Commented code)
Version Used:
Steps to Reproduce:
using Microsoft.CodeAnalysis.MsBuild;
Expected Behavior: Usign Microsoft.CodeAnalysis.MsBuild directive without any problems
Actual Behavior: Had error: The type or namespace name "MsBuild" does not exists in the namespace Microsoft.CodeAnalysis
For another think I had not blocking error with Microsoft.Composition package (included reference) compatibility. It can be fixed by addind System.Composition package reference but I'm not sure that it is the right way.
Did anybody have such problems?