[Mono-list] About .Net Compatibility

Radu-Adrian Popescu radu.popescu@aldratech.com
Thu, 30 Oct 2003 15:11:19 +0200


--=-3xWs77Fl5xXTObJYSiiH
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On Tue, 2003-10-28 at 14:34, Jonathan Pryor wrote:

> See http://www.go-mono.com/faq.html, questions 57-63.  Pay particular
> attention to questions 62 and 63.
> 
> In short, maybe.  It depends on your app.  To quote the more relevant
> questions:
> 
> Question 61: Will applications run out the box with Mono?
> 
> Sometimes they will. But sometimes a .NET application might invoke Win32
> API calls, or assume certain patterns that are not correct for
> cross-platform applications.
> 
> Question 62: What is a 100% .NET application?


I beg to differ. I think my colleagues that have never heard of mono
will tell you that
and 100% .NET app is something that you wrote using VS.NET, from a
crystal report
to a web application.
Caveat lector !


> 
> A `100% .NET application' is one that only uses the APIs defined under
> the System namespace and does not use P/Invoke. These applications would
> in theory run unmodified on Windows, Linux, HP-UX, Solaris, MacOS X and
> others. 
> 
> Note that this requirement also holds for all assemblies used by the
> application. If one of them is Windows-specific, then the entire program
> is not a 100% .NET application.
> 
> Furthermore, a 100% .NET application must not contain non-standard data
> streams in the assembly. For example, Visual Studio .NET will insert a
> #- stream into assemblies built under the "Debug" target. This stream
> contains debugging information for use by Visual Studio .NET; however,
> this stream can not be interpreted by Mono (unless you're willing to
> donate support).
> 
> Thus, it is recommended that all Visual Studio .NET-compiled code be
> compiled under the Release target before it is executed under Mono.
> 
> Question 63: Can I execute my Visual Studio .NET program (Visual Basic
> .NET, Visual C#, Managed Extensions for C++, etc.) under Mono?
> 
> Yes, with some reservations.
> 
> The .NET program must either be a 100% .NET application, or (somehow)
> have all dependent assemblies available on all desired platforms. (How
> to do so is outside the bounds of this FAQ.)
> 
> Mono must also have an implementation for the .NET assemblies used. For
> example the System.EnterpriseServices namespace is part of .NET, but it
> has not been implemented in Mono. Thus, any applications using this
> namespace will not run under Mono.
> 
> With regards to languages, C# applications tend to be most portable.
> 
> Visual Basic .NET applications are portable, but Mono's
> Microsoft.VisualBasic.dll implementation is incomplete. It is
> recommended to either avoid using this assembly in your own code, only
> use the portions that Mono has implemented, or to help implement the
> missing features. Additionally, you can set 'Option Strict On', which
> eliminates the implicit calls to the unimplemented
> Microsoft.VisualBasic.CompilerServices.ObjectType class. (Thanks to
> Jörg Rosenkranz.)
> 
> Managed Extensions for C++ is least likely to operate under Mono. Mono
> does not support mixed mode assemblies (that is, assemblies containing
> both managed and unmanaged code, which Managed C++ can produce). You
> need a fully-managed assembly to run under Mono, and getting the Visual
> C++ .NET compiler to generate such an executable can be difficult. You
> need to use only the .NET-framework assemblies, not the C libraries (you
> can't use printf(3) for example.), and you need to use the linker
> options /nodefaultlib /entry:main mscoree.lib in addition to the /clr
> compiler flag. You can still use certain compiler intrinsic functions
> (such as memcpy(3)) and the STL. You should also see Converting Managed
> Extensions for C++ Projects from Mixed Mode to Pure Intermediate
> Language at MSDN. Finally, you can use PEVERIFY.EXE from the .NET SDK to
> determine if the assembly is fully managed.
> 
> Thanks to Serge Chaban for the linker flags to use.
> 
> 
>  - Jon
> 
> On Mon, 2003-10-27 at 16:05, Carlos dos Santos wrote: 
> > I have an application developed in Visual Studio .Net. This application 
> > will run in Mono ?
> > 
> > Thanks.
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list

-- 
Radu-Adrian Popescu
CSA, DBA, Developer
Aldratech Ltd.
+40213212243

--=-3xWs77Fl5xXTObJYSiiH
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.0.8">
</HEAD>
<BODY>
On Tue, 2003-10-28 at 14:34, Jonathan Pryor wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#737373"><I>See </FONT><A HREF="http://www.go-mono.com/faq.html"><U>http://www.go-mono.com/faq.html</U></A><FONT COLOR="#737373">, questions 57-63.  Pay particular
attention to questions 62 and 63.

In short, maybe.  It depends on your app.  To quote the more relevant
questions:

Question 61: Will applications run out the box with Mono?

Sometimes they will. But sometimes a .NET application might invoke Win32
API calls, or assume certain patterns that are not correct for
cross-platform applications.

Question 62: What is a 100% .NET application?</I></FONT></PRE>
</BLOCKQUOTE>
<BR>
I beg to differ. I think my colleagues that have never heard of mono will tell you that<BR>
and 100% .NET app is something that you wrote using VS.NET, from a crystal report<BR>
to a web application.<BR>
Caveat lector !<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#737373"><I>
A `100% .NET application' is one that only uses the APIs defined under
the System namespace and does not use P/Invoke. These applications would
in theory run unmodified on Windows, Linux, HP-UX, Solaris, MacOS X and
others. 

Note that this requirement also holds for all assemblies used by the
application. If one of them is Windows-specific, then the entire program
is not a 100% .NET application.

Furthermore, a 100% .NET application must not contain non-standard data
streams in the assembly. For example, Visual Studio .NET will insert a
#- stream into assemblies built under the &quot;Debug&quot; target. This stream
contains debugging information for use by Visual Studio .NET; however,
this stream can not be interpreted by Mono (unless you're willing to
donate support).

Thus, it is recommended that all Visual Studio .NET-compiled code be
compiled under the Release target before it is executed under Mono.

Question 63: Can I execute my Visual Studio .NET program (Visual Basic
.NET, Visual C#, Managed Extensions for C++, etc.) under Mono?

Yes, with some reservations.

The .NET program must either be a 100% .NET application, or (somehow)
have all dependent assemblies available on all desired platforms. (How
to do so is outside the bounds of this FAQ.)

Mono must also have an implementation for the .NET assemblies used. For
example the System.EnterpriseServices namespace is part of .NET, but it
has not been implemented in Mono. Thus, any applications using this
namespace will not run under Mono.

With regards to languages, C# applications tend to be most portable.

Visual Basic .NET applications are portable, but Mono's
Microsoft.VisualBasic.dll implementation is incomplete. It is
recommended to either avoid using this assembly in your own code, only
use the portions that Mono has implemented, or to help implement the
missing features. Additionally, you can set 'Option Strict On', which
eliminates the implicit calls to the unimplemented
Microsoft.VisualBasic.CompilerServices.ObjectType class. (Thanks to
J&#195;&#182;rg Rosenkranz.)

Managed Extensions for C++ is least likely to operate under Mono. Mono
does not support mixed mode assemblies (that is, assemblies containing
both managed and unmanaged code, which Managed C++ can produce). You
need a fully-managed assembly to run under Mono, and getting the Visual
C++ .NET compiler to generate such an executable can be difficult. You
need to use only the .NET-framework assemblies, not the C libraries (you
can't use printf(3) for example.), and you need to use the linker
options /nodefaultlib /entry:main mscoree.lib in addition to the /clr
compiler flag. You can still use certain compiler intrinsic functions
(such as memcpy(3)) and the STL. You should also see Converting Managed
Extensions for C++ Projects from Mixed Mode to Pure Intermediate
Language at MSDN. Finally, you can use PEVERIFY.EXE from the .NET SDK to
determine if the assembly is fully managed.

Thanks to Serge Chaban for the linker flags to use.


 - Jon

On Mon, 2003-10-27 at 16:05, Carlos dos Santos wrote: 
&gt; I have an application developed in Visual Studio .Net. This application 
&gt; will run in Mono ?
&gt; 
&gt; Thanks.

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com</FONT>
<A HREF="http://lists.ximian.com/mailman/listinfo/mono-list"><U>http://lists.ximian.com/mailman/listinfo/mono-list</U></I></A></PRE>
</BLOCKQUOTE>
<PRE><TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>-- 
Radu-Adrian Popescu
CSA, DBA, Developer
Aldratech Ltd.
+40213212243</PRE>
</TD>
</TR>
</TABLE>
</PRE>
</BODY>
</HTML>

--=-3xWs77Fl5xXTObJYSiiH--