Bug 54304 - Mono.CSharp.InternalErrorException when building a project
Summary: Mono.CSharp.InternalErrorException when building a project
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: 4.8.0 (C9)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2017-03-30 19:06 UTC by Oleg Anashkin
Modified: 2017-04-03 16:22 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
The offending assembly (1.31 MB, application/x-msdownload)
2017-03-30 19:06 UTC, Oleg Anashkin
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Oleg Anashkin 2017-03-30 19:06:32 UTC
Created attachment 21080 [details]
The offending assembly

I have a project originally created in Visual Studio 2017 on Windows and I am trying to compile it on MacOS using Visual Studio for Mac and Mono 4.8. The compiler fails and throws Mono.CSharp.InternalErrorException with the following stack trace:

Target GenerateTargetFrameworkMonikerAttribute:
  Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
Target CoreCompile:
    /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/4.5/mcs.exe /noconfig /nowarn:1701,1702 /langversion:Default /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE /errorendlocation /preferreduilang:en-US /highentropyva+ /reference:/Users/oanashki/Dropbox/Projects/DeckTracker/lib/core.dll /reference:/Users/oanashki/Dropbox/Projects/DeckTracker/lib/JsonFx.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/4.5-api/mscorlib.dll /reference:/Users/oanashki/Dropbox/Projects/DeckTracker/lib/sausage-core.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/4.5-api/System.Core.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/4.5-api/System.dll /reference:/Users/oanashki/Dropbox/Projects/DeckTracker/lib/UnityEngine.dll /reference:/Users/oanashki/Dropbox/Projects/DeckTracker/lib/UnityEngine.UI.dll /debug+ /debug:full /filealign:512 /optimize- /out:obj/Debug/DeckTracker.dll /subsystemversion:6.00 /target:library /utf8output Card.cs Deck.cs Logger.cs Messages/MessageDispatcher.cs Messages/SequenceMessageHandler.cs Messages/DeckSavedMessageHandler.cs Hook.cs Messages/HydraGameCompletedMessageHandler.cs Messages/IMessageHandler.cs Json.cs Messages/OnlineDecksFoundMessageHandler.cs Messages/PhoenixGameCompletedMessageHandler.cs Properties/AssemblyInfo.cs Messages/RequestQueueMatchMessageHandler.cs State.cs Messages/SurvivalModeStartMessageHandler.cs UI.cs UIHelpers.cs "/var/folders/8r/yk6jn1455nng6t0sjwkjpzwr0009zw/T/.NETFramework,Version=v4.5.AssemblyAttributes.cs"
    
    Unhandled Exception:
    Mono.CSharp.InternalErrorException: Failed to load assembly `core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.ArgumentNullException: Value cannot be null.
    Parameter name: name
      at IKVM.Reflection.TypeName..ctor (System.String ns, System.String name) [0x00006] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at IKVM.Reflection.Reader.TypeDefImpl.get_TypeName () [0x00000] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at IKVM.Reflection.Reader.ModuleReader.PopulateTypeDef () [0x0005d] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at IKVM.Reflection.Reader.ModuleReader.FindType (IKVM.Reflection.TypeName typeName) [0x00000] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at IKVM.Reflection.Reader.AssemblyReader.FindType (IKVM.Reflection.TypeName typeName) [0x00000] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at Mono.CSharp.StaticLoader.HasObjectType (IKVM.Reflection.Assembly assembly) [0x00000] in <6c6b2f38a076460eacf227054ff6f99a>:0 
       --- End of inner exception stack trace ---
      at Mono.CSharp.StaticLoader.HasObjectType (IKVM.Reflection.Assembly assembly) [0x00045] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at Mono.CSharp.AssemblyReferencesLoader`1[T].LoadReferencesCore (Mono.CSharp.ModuleContainer module, T& corlib_assembly, System.Collections.Generic.List`1[System.Tuple`2[Mono.CSharp.RootNamespace,T]]& loaded) [0x00114] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at Mono.CSharp.StaticLoader.LoadReferences (Mono.CSharp.ModuleContainer module) [0x00000] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at Mono.CSharp.Driver.Compile () [0x0022e] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at Mono.CSharp.Driver.Main (System.String[] args) [0x00052] in <6c6b2f38a076460eacf227054ff6f99a>:0 
    [ERROR] FATAL UNHANDLED EXCEPTION: Mono.CSharp.InternalErrorException: Failed to load assembly `core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.ArgumentNullException: Value cannot be null.
    Parameter name: name
      at IKVM.Reflection.TypeName..ctor (System.String ns, System.String name) [0x00006] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at IKVM.Reflection.Reader.TypeDefImpl.get_TypeName () [0x00000] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at IKVM.Reflection.Reader.ModuleReader.PopulateTypeDef () [0x0005d] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at IKVM.Reflection.Reader.ModuleReader.FindType (IKVM.Reflection.TypeName typeName) [0x00000] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at IKVM.Reflection.Reader.AssemblyReader.FindType (IKVM.Reflection.TypeName typeName) [0x00000] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at Mono.CSharp.StaticLoader.HasObjectType (IKVM.Reflection.Assembly assembly) [0x00000] in <6c6b2f38a076460eacf227054ff6f99a>:0 
       --- End of inner exception stack trace ---
      at Mono.CSharp.StaticLoader.HasObjectType (IKVM.Reflection.Assembly assembly) [0x00045] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at Mono.CSharp.AssemblyReferencesLoader`1[T].LoadReferencesCore (Mono.CSharp.ModuleContainer module, T& corlib_assembly, System.Collections.Generic.List`1[System.Tuple`2[Mono.CSharp.RootNamespace,T]]& loaded) [0x00114] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at Mono.CSharp.StaticLoader.LoadReferences (Mono.CSharp.ModuleContainer module) [0x00000] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at Mono.CSharp.Driver.Compile () [0x0022e] in <6c6b2f38a076460eacf227054ff6f99a>:0 
      at Mono.CSharp.Driver.Main (System.String[] args) [0x00052] in <6c6b2f38a076460eacf227054ff6f99a>:0 
    /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/msbuild/15.0/bin/Roslyn/Microsoft.CSharp.Core.targets(67,5): error MSB6006: "mcs.exe" exited with code 1.
Comment 1 Marek Safar 2017-04-03 16:22:21 UTC
It should be fixed in Mono 5.0 and master. Please reopen if you can still reproduce it with full repro.