Roslyn: Roslyn failing on latest coreclr

Created on 13 Dec 2018  路  4Comments  路  Source: dotnet/roslyn

This is blocking insertion of runtime into core-sdk in https://github.com/dotnet/core-sdk/pull/204

error MSB4061: The "Csc" task could not be instantiated from "D:\Src\core-sdk\bin\2\win-x64\dotnet\sdk\3.0.100-preview-009827\Roslyn\Microsoft.Build.Tasks.CodeAnalysis.dll". 

System.TypeInitializationException: The type initializer for 'Microsoft.CodeAnalysis.BuildTasks.ManagedCompiler' threw an exception. 
---> System.TypeInitializationException: The type initializer for 'Microsoft.CodeAnalysis.BuildTasks.AssemblyResolution' threw an exception. 
---> System.TypeInitializationException: The type initializer for '_AppDomain' threw an exception. 
---> System.ArgumentNullException: Value cannot be null.
Parameter name: type
   at System.Reflection.IntrospectionExtensions.GetTypeInfo(Type type)
   at Roslyn.Utilities.CorLightup.Desktop._AppDomain..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.CodeAnalysis.BuildTasks.AssemblyResolution..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.CodeAnalysis.BuildTasks.ManagedCompiler..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.CodeAnalysis.BuildTasks.ManagedCompiler..ctor()
   at Microsoft.CodeAnalysis.BuildTasks.Csc..ctor() 

Why is code in CorLightup.Desktop running on CoreCLR? It is failing against implementation changes in .NET Core 3.0.

cc @jaredpar @jkotas

Area-Compilers Bug

All 4 comments

Roslyn is doing private reflection against CoreLib. The private reflection happened to pick up internal broken CoreLib System.AppDomain type before. I have cleaned this up recently and this private broken System.AppDomain type does not exist anymore. The actual System.AppDomain type lives in System.Runtime.Extensions.

Isn't the build task multi targeted to net472;netcoreapp2.1 now? Is this lightup still needed?

I don't think that light up code is needed anymore. Pretty sure it was added before we did the multi-targeting work.

Yeah so much of that is nonsense code now. I've removed almost all of it across the code base.

Was this page helpful?
0 / 5 - 0 ratings