C
C#8mo ago
temp0

Using Roslyn in WebAssembly, error creating an AdHocWorkspace

Hello, this could be a really convoluted use case and I don't know what sort of support is expected to work here, although I've seen examples working in Blazor where people can create a Workspace, Project, Document, etc. from Roslyn. I am using a library called bootsharp (https://github.com/elringus/bootsharp) to compile a dotnet project to wasm, the easy stuff is working just fine, simple types/function invoking etc. My goal is to create a Roslyn workspace to be able to get completion data for the Monaco editor and I am trying to new up a Workspace with
var workspace = new AdhocWorkspace(MefHostServices.DefaultHost);
var workspace = new AdhocWorkspace(MefHostServices.DefaultHost);
And I am busting on what looks like some DI for a WorkspaceServiceMetadata service from the host. I am at the end of my debugging abilities and humbly ask for an outside opinion here. Am I out of my league, is there a way to get something like this working? Attached a stack trace of the managed side. The error is
"Error: The type 'WorkspaceServiceMetadata' cannot be used as a metadata view. A metadata view must be a concrete class with a parameterless or dictionary constructor.
"Error: The type 'WorkspaceServiceMetadata' cannot be used as a metadata view. A metadata view must be a concrete class with a parameterless or dictionary constructor.
GitHub
GitHub - elringus/bootsharp: Compile C# solution into single-file E...
Compile C# solution into single-file ES module with auto-generated JavaScript bindings and type definitions - elringus/bootsharp
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server