[Mono-list] Trouble building with Microsoft dlls

doal doal.miller at mir3.com
Tue May 24 20:49:27 EDT 2011

I'm new to Mono so this is probably something simple or maybe I'm
misunderstanding what can be done. I'm developing on Linux in Java but we
just had a requirement to interface with MS Exchange Server so we wrote a
Transport Agent in C#. That agent gets plugged into Exchange so it is
obviously going to be run on Windows using .NET.

However since our entire product builds under ant on Linux we wanted to
build the Agent there also and then install it and run it on Windows,
Exchange Server. My first assumption is that this is possible.

I read up on NAnt and Mono and got a build of a trivial C# program working.
I then tried to build my Agent which uses the Microsoft dlls like
Microsoft.Exchange.Data.Common.dll, Microsoft.Exchange.Data.Transport.dll,
and a few others. When I look at their file types on Linux it says:
lib/Microsoft.Exchange.Data.Transport.dll: PE32 executable for MS Windows
(DLL) (console) Intel 80386 32-bit Mono/.Net assembly

So they seem to be .NET assembly files which is what Mono wants, right?

Yet when I try and build and I point the build to the dlls with the
following in my default.build file:
                <include name="lib/*.dll" />

I get a these errors like this:
      [csc] Compiling 2 files to
      [csc] ** (/usr/lib/mono/2.0/gmcs.exe:10018): WARNING **: The class
System.Web.Management.WebRequestErrorEvent could not be loaded, used in
System.Web, Version=, Culture=neutral,
      [csc] ** (/usr/lib/mono/2.0/gmcs.exe:10018): WARNING **: The class
System.Web.UI.IUpdatePanel could not be loaded, used in System.Web,
Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
      [csc] Unhandled Exception:
System.Reflection.ReflectionTypeLoadException: The classes in the module
cannot be loaded.
      [csc]   at (wrapper managed-to-native)
System.Reflection.Assembly:GetTypes (bool)
      [csc]   at System.Reflection.Assembly.GetTypes () [0x00000] 
      [csc]   at Mono.CSharp.RootNamespace.ComputeNamespaces
(System.Reflection.Assembly assembly) [0x00000] 
      [csc]   at Mono.CSharp.RootNamespace.ComputeNamespaces () [0x00000] 
      [csc]   at Mono.CSharp.Driver.LoadReferences () [0x00000] 
      [csc]   at Mono.CSharp.Driver.Compile () [0x00000] 
      [csc]   at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] 

BUILD FAILED - 0 non-fatal error(s), 10 warning(s)

External Program Failed: /usr/lib/mono/2.0/gmcs.exe (return code was 1)

So, shouldn't I be able to build this? I saw one post saying to use the
apt-get version of nant but that's what I'm using. Any help would be greatly
appreciated. Thanks

View this message in context: http://mono.1490590.n4.nabble.com/Trouble-building-with-Microsoft-dlls-tp3548648p3548648.html
Sent from the Mono - General mailing list archive at Nabble.com.

More information about the Mono-list mailing list