dotnet / corert

This repo contains CoreRT, an experimental .NET Core runtime optimized for AOT (ahead of time compilation) scenarios, with the accompanying compiler toolchain.
http://dot.net
MIT License
2.91k stars 508 forks source link

Building SampleWebApi with Release configuration gives error #6155

Closed mattvaughan closed 6 years ago

mattvaughan commented 6 years ago

Building the SampleWebApi project in Debug mode works normally, but switching to the Release configuration yields this type error. This is running version 1.0.0-alpha-26730-01:

dotnet publish -r linux-x64 -c Release

EXEC : error : Unable to cast object of type 'ILCompiler.AnalysisBasedMetadataManager' to type 'ILCompiler.UsageBasedMetadataManager'. [/home/matt/projects/corert/samples/WebApi/SampleWebApi.csproj]
  System.InvalidCastException: Unable to cast object of type 'ILCompiler.AnalysisBasedMetadataManager' to type 'ILCompiler.UsageBasedMetadataManager'.
     at ILCompiler.DependencyAnalysis.TypeMetadataNode.GetStaticDependencies(NodeFactory factory)
     at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.GetStaticDependenciesImpl(DependencyNodeCore`1 node)
     at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ProcessMarkStack()
     at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ComputeMarkedNodes()
     at ILCompiler.RyuJitCompilation.CompileInternal(String outputFile, ObjectDumper dumper)
     at ILCompiler.Compilation.ILCompiler.ICompilation.Compile(String outputFile, ObjectDumper dumper)
     at ILCompiler.Program.Run(String[] args)
     at ILCompiler.Program.Main(String[] args)
/home/matt/.nuget/packages/microsoft.dotnet.ilcompiler/1.0.0-alpha-26730-01/build/Microsoft.NETCore.Native.targets(185,5): error MSB3073: The command ""/home/matt/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-26730-01/tools/ilc" @"obj/Release/netcoreapp2.1/linux-x64/native/SampleWebApi.ilc.rsp"" exited with code 1. [/home/matt/projects/corert/samples/WebApi/SampleWebApi.csproj]
MichalStrehovsky commented 6 years ago

I fixed that yesterday in #6152. Try dotnet restore to pick up the latest version of the compiler.

MichalStrehovsky commented 6 years ago

We can reopen if you're still seeing this with 26731+ builds of the compiler.