Bug 368625

Summary: Special output from mcs not parsed correctly
Product: [Mono] MonoDevelop Reporter: Andres Aragoneses <aaragoneses>
Component: projectAssignee: Lluis Sanchez <lluis>
Status: VERIFIED FIXED QA Contact: MD Bugs <monodevelop-bugs>
Severity: Normal    
Priority: P5 - None    
Version: 0.19 (RC 1)   
Target Milestone: 2.0 Beta 1   
Hardware: Other   
OS: openSUSE 10.3   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Forgot to add the attachment

Description Andres Aragoneses 2008-03-10 11:49:43 UTC
When creating a project which references to GTK# but not GLib#, I get the following MCS output:


** (/usr/lib/mono/2.0/gmcs.exe:5738): WARNING **: The following assembly referenced from /home/knocte/Documents/iDocuments/Proyectos/mono/a11y/SVNtree/gtk-sharp/gtk/gtk-sharp.dll could not be loaded:
     Assembly:   glib-sharp    (assemblyref_index=0)
     Version:    2.12.0.0
     Public Key: 35e10195dab3c99f
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 (/home/knocte/Documents/iDocuments/Proyectos/mono/a11y/SVNtree/gtk-sharp/gtk).


** (/usr/lib/mono/2.0/gmcs.exe:5738): WARNING **: Could not load file or assembly 'glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f' or one of its dependencies.

** (/usr/lib/mono/2.0/gmcs.exe:5738): WARNING **: Missing method .ctor in assembly /home/knocte/Documents/iDocuments/Proyectos/mono/a11y/SVNtree/gtk-sharp/gtk/gtk-sharp.dll, type GLib.IgnoreClassInitializersAttribute

** (/usr/lib/mono/2.0/gmcs.exe:5738): WARNING **: Can't find custom attr constructor image: /home/knocte/Documents/iDocuments/Proyectos/mono/a11y/SVNtree/gtk-sharp/gtk/gtk-sharp.dll mtoken: 0x0a000111
Stacktrace:



Build complete -- 1 error, 0 warnings

---------------------- Done ----------------------

Build: 1 error, 0 warnings


However, MonoDevelop reports a strange error on the error list, which I attach as a screenshot.

I remember that even MS VisualStudio has a specific .NET error message for this, so I guess this is a bug.
Comment 1 Andres Aragoneses 2008-03-12 16:14:10 UTC
Created attachment 200879 [details]
Forgot to add the attachment
Comment 2 Andres Aragoneses 2008-05-22 15:15:47 UTC
Beware that this bug is *now* related to gmcs bug 376876, which tells that in this situation now you even get an exception in the compiler.
Comment 3 Lluis Sanchez 2008-12-09 17:11:59 UTC
I can't repro. I think that was fixed. Can you confirm?
Comment 4 Andres Aragoneses 2008-12-09 18:20:22 UTC
I can still reproduce, but the results are not exactly the same as what we got when I firstly reported this.

To be able to reproduce, do this steps:

1. Copy gtk-sharp.dll from the GAC to other place near your project.
2. Reference your gtk-sharp.dll in the project (don't use the GAC one).
3. Move temporarily the glib-sharp.dll from the GAC to other place, in order not to be found.
4. Compile.

Current results:
It reports a misleading error because it makes the developer think that the library was not referenced, instead of telling the user that a dependency of the library is missing: "The type or namespace name `AboutDialog' does not exist in the namespace `Gtk'. Are you missing an assembly reference?(CS0234)"

And in the build output I can see:
Building: Test (Debug)
Performing main compilation...
/home/knocte/opt/mono/bin/gmcs "/out:/home/knocte/Projects/Test/Test/bin/Debug/Test.exe" "/r:System.dll" "/r:System.Web.dll" "/r:System.Xml.dll" "/r:/home/knocte/Projects/Test/TestLib/bin/Debug/TestLib.dll" "/r:/home/knocte/Projects/Test/Test/gtk-sharp.dll" /noconfig /nologo /warn:4 /debug:+ /debug:full /optimize- /codepage:utf8 /define:"DEBUG" /t:exe "/home/knocte/Projects/Test/Test/Main.cs" "/home/knocte/Projects/Test/Test/AssemblyInfo.cs" 
Compilation failed: 1 error(s), 1 warnings


** (/home/knocte/opt/mono/lib/mono/2.0/gmcs.exe:24519): WARNING **: The following assembly referenced from /home/knocte/Projects/Test/Test/gtk-sharp.dll could not be loaded:
     Assembly:   glib-sharp    (assemblyref_index=0)
     Version:    2.12.0.0
     Public Key: 35e10195dab3c99f
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 (/home/knocte/Projects/Test/Test/).


** (/home/knocte/opt/mono/lib/mono/2.0/gmcs.exe:24519): WARNING **: Could not load file or assembly 'glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f' or one of its dependencies.
/home/knocte/Projects/Test/Test/Main.cs(79,21): error CS0234: The type or namespace name `AboutDialog' does not exist in the namespace `Gtk'. Are you missing an assembly reference?
/home/knocte/Projects/Test/Test/Main.cs(100,40): warning CS0219: The variable `adapter' is assigned but its value is never used


You may think that this specific scenario is very wierd (who would want to remove Glib# from the GAC?), but actually, if we are talking about other assemblies than gtk/glib, this happens often.
Comment 5 Lluis Sanchez 2009-01-08 15:45:36 UTC
I tried to reproduce and worked fine. I think it was fixed by r121871.
Comment 6 Lluis Sanchez 2009-01-08 15:46:05 UTC
Closing.