-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-System.Text.Jsondisabled-testThe test is disabled in source code against the issueThe test is disabled in source code against the issue
Milestone
Description
Our System.Text.Json.SourceGeneration.Tests use the following to add references to the compilation:
Lines 31 to 37 in 7994e59
| 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.
Metadata
Metadata
Assignees
Labels
area-System.Text.Jsondisabled-testThe test is disabled in source code against the issueThe test is disabled in source code against the issue