Bug 17170 - mscorlib.dll fails to build (TypeLoadException Mono.CSharp.CommandLineParser)
Summary: mscorlib.dll fails to build (TypeLoadException Mono.CSharp.CommandLineParser)
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-01-10 10:13 UTC by jacotb
Modified: 2014-05-05 12:50 UTC (History)
4 users (show)

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

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 jacotb 2014-01-10 10:13:53 UTC
When building mono from source from today's git snapshot (2014-01-10), mscorlib.dll fails to build with the following message:

mkdir -p -- ../../class/lib/build/tmp/
MCS     [build] mscorlib.dll

Unhandled Exception:
System.TypeLoadException: Could not load type 'Mono.CSharp.CommandLineParser' from assembly 'basic, Version=3.2.7.0, Culture=neutral, PublicKeyToken=null'.
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'Mono.CSharp.CommandLineParser' from assembly 'basic, Version=3.2.7.0, Culture=neutral, PublicKeyToken=null'.
make[8]: *** [../../class/lib/build/tmp/mscorlib.dll] Error 1
make[7]: *** [do-all] Error 2
make[6]: *** [all-recursive] Error 1
make[5]: *** [all-recursive] Error 1
make[4]: *** [profile-do--build--all] Error 2
make[3]: *** [profiles-do--all] Error 2
make[2]: *** [all-local] Error 2
make[2]: Leaving directory `/home/###/mono-git/mono/runtime'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/###/mono-git/mono'
make: *** [all] Error 2


I'm on Debian wheezy 7.3 kernel 3.2.0-4-amd64.



The final output of autogen.sh PREFIX=/usr was:

Git submodules updated successfully

        mcs source:    mcs

   Engine:
        GC:            sgen and bundled Boehm GC with typed GC and parallel mark
        TLS:           __thread
        SIGALTSTACK:   yes
        Engine:        Building and using the JIT
        oprofile:      no
        BigArrays:     no
        DTrace:        no
        LLVM Back End: no (dynamically loaded: no)

   Libraries:
        .NET 2.0/3.5:  yes
        .NET 4.0:      yes
        .NET 4.5:      yes
        MonoDroid:     no
        MonoTouch:     no
        JNI support:   IKVM Native
        libgdiplus:    assumed to be installed
        zlib:          system zlib


Now type `make' to compile
Comment 1 nhusted 2014-01-31 09:28:49 UTC
I've recreated this on Debian testing. 

Mono version used to boot-strap the compile process (as the git repository needs gcms to run):
Mono JIT compiler version 3.0.6 (Debian 3.0.6+dfsg2-10)

Command for compiling the git repository: ./autogen.sh --prefix=/opt/mono

Git version: 3.2.7 master (commit 6de1a802b24935065e7a48b802cf21982ea35109)

Workaround: 
make clean (I might have just deleted and re-downloaded the repository to make SURE nothing was cached)
make get-monolite-latest
make EXTERNAL_MCS="${PWD}/mcs/class/lib/monolite/gmcs.exe"
Comment 2 Miguel de Icaza [MSFT] 2014-02-12 12:11:09 UTC
Works on our dailies now
Comment 3 Borat 2014-05-05 12:50:16 UTC
It works with this workaround. But when I try to do standard build from latest github source files I get same error. I don't think this is "resolved" issue.

Workaround:

make clean
./autogen.sh --prefix=/opt/mono
make get-monolite-latest
make EXTERNAL_MCS="${PWD}/mcs/class/lib/monolite/gmcs.exe"