Skip to content

System.Text.Json.SourceGeneration.Unit.Tests are disabled in WASM #58226

@eerhardt

Description

@eerhardt

Our System.Text.Json.SourceGeneration.Tests use the following to add references to the compilation:

List<MetadataReference> references = new List<MetadataReference> {
MetadataReference.CreateFromFile(typeof(object).Assembly.Location),
MetadataReference.CreateFromFile(typeof(Attribute).Assembly.Location),
MetadataReference.CreateFromFile(typeof(Type).Assembly.Location),
MetadataReference.CreateFromFile(typeof(KeyValuePair).Assembly.Location),
MetadataReference.CreateFromFile(typeof(ContractNamespaceAttribute).Assembly.Location),
MetadataReference.CreateFromFile(typeof(JavaScriptEncoder).Assembly.Location),

This doesn't work in browser-wasm because Assembly.Location returns string.Empty. Thus we get exceptions that empty string is not a valid file path.

If we feel we need to run these tests on browser-wasm, we need to figure out a way to reference these assemblies so Roslyn can compile code.

cc @lewing @radical

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions