dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.92k stars 4.02k forks source link

Scripting has issues resolving types on Mono #30303

Open jaredpar opened 5 years ago

jaredpar commented 5 years ago

When executed a number of tests are printing out extra error messages of the form:

error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

The errors also include int.

filipw commented 5 years ago

it's been like this since the beginning. The workaround in the past for CSI was to copy System.Runtime into the CSI directory. In OmniSharp we always add arbitrary reference to System.Runtime too, to facilitate scripting language services on Mono https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.Roslyn/Utilities/DefaultMetadataReferencesHelper.cs#L20

Would be great to get this fixed.