[Mono-aspnet-list] Fix good error msg which has been changed to a useless horrible one

acidzombie24 acidzombie24 at gmail.com
Mon Dec 27 22:53:12 EST 2010


This is more of a comment. In mono tag 2.8.1 and the current master
(https://github.com/mono/mono/commit/f59335471f046a3adde71bf1b5e91673884e10d5)
when forgetting a dll reference (such as System.Data.MySql) i get the
current error below. Its almost completely useless. I had no idea i was
missing a DLL and was trying to figure out why my class wasnt being loaded
(When you refresh it names the first class it tries to access as not being
load-able)

Someone suggested building the sources via xbuild on the server and i
figured out i was missing the MySql reference. I remember an older version
giving me a better msg so i downgraded to 2.6.7

It tells you exactly what DLL is missing and it throws in the callstack used
where it access the missing DLL. I would like this msg again since it tells
you what has gone wrong and AFAIK its not less secure (but it could be?) as
by default web.config doesnt allow it to be shown remotely (it is shown
local only by default)

----------------- Current ----------------- 
Server Error in '/' Application
A type load exception has occurred.

Description: HTTP 500. Error processing request.

Stack Trace:

System.TypeLoadException: A type load exception has occurred.
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
(System.Reflection.MonoMethod*,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 

Version information: Mono Runtime Version: 2.8.1 (tarball Mon Dec 27
10:20:03 UTC 2010); ASP.NET Version: 2.0.50727.1433

----------------- The Better Msg taken from 2.6.7 ----------------- 

Server Error in '/' Application
Compilation Error

Description: Error compiling a resource required to service this request.
Review your source file and modify it to fix this error.

Compiler Error Message: : ** (/usr/local/lib/mono/2.0/gmcs.exe:17243):
WARNING **: The following assembly referenced from
/var/www/sitename/bin/sitename.dll could not be loaded:
~/Global.asax
Show Detailed Compiler Output:

gmcs /target:library /lib:"/var/www/sitename/bin" /debug+ /optimize- /warn:4
/out:"/tmp/www-data-temp-aspnet-0/4782c6d3/App_global.asax_1dff708b.dll"
/r:"/usr/local/lib/mono/gac/System/2.0.0.0__b77a5c561934e089/System.dll"
/r:"/usr/local/lib/mono/gac/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll"
/r:"/usr/local/lib/mono/gac/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll"
/r:"/usr/local/lib/mono/gac/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll"
/r:"/usr/local/lib/mono/gac/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll"
/r:"/usr/local/lib/mono/gac/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll"
/r:"/usr/local/lib/mono/gac/System.Runtime.Serialization/3.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll"
/r:"/usr/local/lib/mono/gac/System.IdentityModel/3.0.0.0__b77a5c561934e089/System.IdentityModel.dll"
/r:"/usr/local/lib/mono/gac/System.ServiceModel/3.0.0.0__b77a5c561934e089/System.ServiceModel.dll"
/r:"/usr/local/lib/mono/gac/System.ServiceModel.Web/3.5.0.0__31bf3856ad364e35/System.ServiceModel.Web.dll"
/r:"/usr/local/lib/mono/gac/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll"
/r:"/usr/local/lib/mono/gac/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll"
/r:"/usr/local/lib/mono/gac/System.Data.DataSetExtensions/3.5.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll"
/r:"/usr/local/lib/mono/gac/System.Web.Extensions/3.5.0.0__31bf3856ad364e35/System.Web.Extensions.dll"
/r:"/usr/local/lib/mono/gac/System.Xml.Linq/3.5.0.0__b77a5c561934e089/System.Xml.Linq.dll"
/r:"/var/www/sitename/bin/Lucene.Net.dll"
/r:"/var/www/sitename/bin/sitename.dll"  /nowarn:0169 /d:DEBUG  --
"/tmp/www-data-temp-aspnet-0/4782c6d3/App_global.asax_1dff708b_0.cs" 


** (/usr/local/lib/mono/2.0/gmcs.exe:17243): WARNING **: The following
assembly referenced from /var/www/sitename/bin/sitename.dll could not be
loaded:
     Assembly:   MySql.Data    (assemblyref_index=1)
     Version:    6.2.3.0
     Public Key: c5687fc88969c44d
The assembly was not found in the Global Assembly Cache, a path listed in
the MONO_PATH environment variable, or in the location of the executing
assembly (/var/www/sitename/bin/).


** (/usr/local/lib/mono/2.0/gmcs.exe:17243): WARNING **: Could not load file
or assembly 'MySql.Data, Version=6.2.3.0, Culture=neutral,
PublicKeyToken=c5687fc88969c44d' or one of its dependencies.

...

** (/usr/local/lib/mono/2.0/gmcs.exe:17243): WARNING **: The class
c__AnonStorey5 could not be loaded, used in sitename, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null

** (/usr/local/lib/mono/2.0/gmcs.exe:17243): WARNING **: The class
c__AnonStorey6 could not be loaded, used in sitename, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null

Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The
classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetTypes () [0x00000] in :0 
  at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly
assembly, System.Type extensionType) [0x00000] in :0 
  at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext
ctx, System.Type extensionType) [0x00000] in :0 
  at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces
(Mono.CSharp.CompilerContext ctx) [0x00000] in :0 
  at Mono.CSharp.Driver.LoadReferences () [0x00000] in :0 
  at Mono.CSharp.Driver.Compile () [0x00000] in :0 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in :0 

Version information: Mono Runtime Version: 2.6.7 (tarball Tue Dec 28
02:52:59 UTC 2010); ASP.NET Version: 2.0.50727.1433

-- 
View this message in context: http://mono.1490590.n4.nabble.com/Fix-good-error-msg-which-has-been-changed-to-a-useless-horrible-one-tp3165676p3165676.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.


More information about the Mono-aspnet-list mailing list