Bug 16286 - A type load exception has occurred. at Mono.WebServer.ModMonoWorker.Run
Summary: A type load exception has occurred. at Mono.WebServer.ModMonoWorker.Run
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Web ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-11-15 17:13 UTC by guivho
Modified: 2013-12-13 15:08 UTC (History)
2 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 guivho 2013-11-15 17:13:39 UTC
Whenever I run one of my .net sites on my apache server (local iMac machine), I get 

   Internal Server Error

   The server encountered an internal error or misconfiguration and was unable to complete your request.

   Please contact the server administrator, you@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

   More information about this error may be available in the server error log.


The apache2 error log has following info:

   System.TypeLoadException: A type load exception has occurred.
      at Mono.WebServer.ModMonoWorker.Run (System.Object state) [0x00000] in <filename unknown>:0 
   [Fri Nov 15 22:58:39 2013] [error] (70014)End of file found: read_data failed

I tested my configuration with `sudo apachectl -t` and it says `Syntax OK`.

I just republished the app to my server and that did not help.
 
Note that I had to reinstall modmono after upgrading to Maverick.

This might well be caused by my installation, but I would like your expert opinion as well as advise about how to proceed.

TIA,

Guido
Comment 1 Zoltan Varga 2013-11-16 02:46:55 UTC
-> System.Web
You can try running with the MONO_LOG_LEVEL environment variable set to 'debug', that might print out more information to the log file.
Comment 2 guivho 2013-11-16 03:31:47 UTC
Now I get 

System.Configuration.ConfigurationErrorsException
Error deserializing configuration section compilation: Unrecognized attribute 'targetFramework'. (/Users/guivho/www/mocash/web.config line 1)

The web.config installed by Xamarin Studio is:
<?xml version="1.0"?>
<!--
Web.config file for Go2.

The settings that can be used in this file are documented at
http://www.mono-project.com/Config_system.web and
http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
-->
<configuration>
  <system.web>
    <compilation defaultLanguage="C#" debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </assemblies>
    </compilation>
    <customErrors mode="RemoteOnly" />
    <authentication mode="None" />
    <authorization>
      <allow users="*" />
    </authorization>
    <httpHandlers />
    <trace enabled="false" localOnly="true" pageOutput="false" requestLimit="10" traceMode="SortByTime" />
    <sessionState mode="InProc" cookieless="false" timeout="20" />
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
  </system.web>
</configuration>

This site runs without any problems from within Xamarin Studio. It is the version deployed to my local apache server that doesn't.
Comment 3 guivho 2013-11-26 12:55:30 UTC
Please advise
Comment 4 guivho 2013-12-03 15:38:29 UTC
please advise
Comment 5 guivho 2013-12-13 10:10:58 UTC
Could you please at least suggest where I can get any support from Xamarin! 

This ticket has been open for almost a month now.

Pleeeeez advise!

Guido
Comment 6 guivho 2013-12-13 15:08:03 UTC
I got this resolved using instructions at http://www.mono-project.com/AutoHosting