© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y 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.
message.txt4.08KB
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
GitHub - elringus/bootsharp: Compile C# solution into single-file E...
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

❔ CSharpCompilation using Roslyn
C#CC# / help
3y ago
❔ Roslyn compilation error (dynamic keyword)
C#CC# / help
3y ago
Anybody using the new roslyn lsp update in neovim?
C#CC# / help
2mo ago
Using Blazor WebAssembly for client interactions in Blazor Server
C#CC# / help
2y ago