/
faq
1670 lines (1188 loc) · 65.1 KB
/
faq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<a href="#basics">Basics</a><br>
<a href="#novell">The Novell Role in the Mono project</a><br>
<a href="#gnome">Mono and GNOME</a><br>
<a href="#gui">Building GUI applications with Mono</a><br>
<a href="#msft">Mono and Microsoft</a><br>
<a href="#platforms">Mono platforms</a><br>
<a href="#compatibility">Compatibility</a></br>
<a href="#pnpproject">Mono and the Portable.NET Project</a><br>
<a href="#webservices">Web Services</a><br>
<a href="#asp">Mono and ASP.NET</a><br>
<a href="#ado">Mono and ADO.NET</a><br>
<a href="#monodoc">MonoDoc</a><br>
<a href="#devel">Development Tools and Issues</a><br>
<a href="#java">Mono and Java</a><br>
<a href="#extending">Extending Mono</a><br>
<a href="#portability">Portability</a><br>
<a href="#reuse">Reusing Existing Code</a><br>
<a href="#gcc">Mono and GCC</a><br>
<a href="#performance">Performance</a><br>
<a href="#licensing">Licensing</a><br>
<a href="#patents">Patents</a><br>
<a href="#etc">Miscellaneous Questions</a><br>
<a href="#obfuscation">Obfuscation</a></br>
<a href="#problems">Mono Common Problems</a><br>
A <a
href="http://www.monohispano.org/tutoriales/mono-puf//">Spanish
translation</a> is also available (it is outdated though)
<a name="basics"></a>
** Basics
Q: What is Mono exactly?
A: The Mono Project is an open development initiative sponsored by
Ximian that is working to develop an open source, Unix
version of the Microsoft .NET development platform. Its objective
is to enable Unix developers to build and
deploy cross-platform .NET Applications. The project will
implement various technologies developed by Microsoft that have now
been submitted to the ECMA for standardization.
The Mono project has also sparked a lot of interest in developing
C#-based components, libraries and frameworks. Today Mono is not
limited to implement the .NET Framework, but also contains other
components. Some of the components of the Mono platform were
developed by the Mono team, and some others we have incorporated
from other open source efforts, the most important ones:
<ul>
<li><a
href="http://remoting-corba.sourceforge.net/">Remoting.CORBA</a>: A
CORBA implementation for Mono.
<li>Ginzu: An implementation on top of Remoting for the <a
href="http://www.zeroc.com">ICE</a> stack
<li><a href="http://gtk-sharp.sf.net">Gtk#</a>: Bindings for
the popular Gtk+ GUI toolkit for Unix and Windows systems.
Other bindings are available: Diacanvas-Sharp and MrProject.
<li><a
href="http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx">#ZipLib</a>:
A library to manipulate various kinds of compressed files and
archives (Zip and tar).
<li>GlGen (available from the Mono CVS): Bindings for OpenGL.
<li>Mono.LDAP: LDAP access for .NET apps.
<li>Mono.Data: We ship support for Postgress, MySql, Sybase,
DB2, SqlLite, Tds (SQL server protocol) and Oracle databases.
<li>Mono.Cairo: Bindings for the <a
href="http://www.cairographics.org">Cairo</a> rendering
engine (Our System.Drawing is implemented on top of this).
<li>Mono.Posix: Bindings for building POSIX applications using
C#.
<li>Mono.Http: Support for creating custom, embedded HTTP
servers and common HTTP handlers for your applications.
</ul>
Q: What is the difference between Mono and the .NET Initiative?
A: The ".NET Initiative" is a somewhat nebulous company-wide effort by
Microsoft, one part of which is a cross-platform development
framework. Mono is an implementation of the development framework,
but not an implementation of anything else related to the .NET
Initiative, such as Passport or software-as-a-service.
Q: What technologies are included in Mono?
A: Mono contains a number of components useful for building new
software:
<ul>
* A Common Language Infrastructure (CLI) virtual
machine that contains a class loader, Just-in-time
compiler, and a garbage collecting runtime.
* A class library that can work with any language
which works on the CLR. Both .NET compatible class
libraries as well as Mono-provided class libraries
are included.
* A compiler for the C# language. In the future we
might work on other compilers that target the Common
Language Runtime.
</ul>
Windows has compilers that target the virtual machine from <a
href="http://msdn.microsoft.com/net/thirdparty/default.asp#lang">a
number of languages:</a> Managed C++, Java Script, Eiffel,
Component Pascal, APL, Cobol, Perl, Python, Scheme,
Smalltalk, Standard ML, Haskell, Mercury and Oberon.
The CLR and the Common Type System (CTS) enables applications and
libraries to be written in a collection of different languages that
target the byte code
This means for example that if you define a class to do algebraic
manipulation in C#, that class can be reused from any other
language that supports the CLI. You could create a class in C#,
subclass it in C++ and instantiate it in an Eiffel program.
A single object system, threading system, class libraries, and
garbage collection system can be shared across all these languages.
Q: Where can I find the specification for these technologies?
A: You can find the information here:
C# <a href="http://www.ecma.ch/ecma1/STAND/ecma-334.htm">http://www.ecma.ch/ecma1/STAND/ecma-334.htm</a>
CLI <a href="http://www.ecma.ch/ecma1/STAND/ecma-335.htm">http://www.ecma.ch/ecma1/STAND/ecma-335.htm</a>
Q: Will you implement the .NET Framework SDK class libraries?
A: Yes, we will be implementing the APIs of the .NET Framework SDK
class libraries.
Q: Will you offer an ECMA-compliant set of class libraries?
A: Eventually we will. Our current focus is on inter-operating
with the Microsoft SDK, but we will also offer an ECMA compliant
subset of the libraries.
Q: What does the name "Mono" mean?
A: Mono is the word for `monkey' in Spanish. We like monkeys.
Q: Does Mono work today?
A: The execution engine works on various platforms, we support
Just-in-Time and Ahead-of-Time compilations on Intel x86 machines
(and soon PowerPC).
The class libraries are mature enough to run various real
applications: our C# compiler, ASP.NET, and Gtk#-based
applications.
Q: When will you ship Mono?
A: Please see the <a href="mono-roadmap.html">Mono Roadmap</a> for
more details on the release plans.
Q: How can I contribute?
A: Check the <a href="contributing.html">contributing</a> section.
Q: Aren't you just copying someone else's work?
A: We are interested in providing the best tools for programmers to
develop applications for Free Operating Systems. We also want to help
provide the interoperability that will allow those systems to fit in
with other standards.
For more background, read the <a href="http://www.go-mono.com/rationale.html">Mono
Project white paper</a>.
the project.
Q: Miguel said once that Mono was being implemented in COBOL. Is that true?.
A: No. It was a joke.
<a name="novell"></a>
** The Novell Role in the Mono Project
Q: Why is Novell working on .NET?
A: Novell is interested in providing the best tools for programmers to
develop applications for Free Operating Systems.
For more information, read the project <a
href="rationale.html">rationale</a> page.
Q: Will Novell be able to take on a project of this size?
A: Of course not. Novell is a supporter of the Mono project, but the only way
to implement something of this size is for the entire free software
community to get involved. Visit the <a href="contributing.html">contributing</a>
page if you'd like to help out.
Q: What pieces is Novell working on?
A: We will devote most of our resources to work on the pieces which are
on the critical path to release a development and execution
environment. Once the project is at a stage where it is useful in
the real world, it will achieve a critical mass of developers to
improve it further.
Q: Will Novell offer Mono commercially?
A: When Mono is ready to be shipped Ximian will offer a commercial
support and services for Mono. Mono components are also
available to be licensed commercially. For licensing details,
contact <a
href="mailto:mono-licensing@ximian.com">mono-licensing@ximian.com</a>
Q: Does Novell provide consulting services around Mono?
A: Yes, Novell does provide consulting services around Mono to
make it suitable to your needs. Porting the runtime engine,
customizing it, working on specific classes or tuning the code
for your particular needs.
Please contact <a
href="mailto:mono-licensing@ximian.com">mono-licensing@ximian.com</a>
for consulting services information.
Q: Will you wait until Mono is finished?
A: Mono will ship on various stages as they mature. Some people
require only a subset of the technologies, those will ship first,
see the <a href="mono-roadmap.html">Mono Roadmap</a> for details
<a name="gnome"></a>
** Mono and GNOME
Q: How is Mono related to GNOME?
A: In a number of ways. This project was born out of the need of
providing improved tools for the GNOME community, and will use
existing components that have been developed for GNOME when they
are available. For example, we plan to use Gtk+ and Libart to
implement Winforms and the Drawing2D API and are considering
GObject support.
Mono team members work actively on the <a
href="http://gtk-sharp.sf.net">Gtk#</a> project: a binding of the
GNOME class libraries for .NET and Mono.
Q: Has the GNOME Foundation or the GNOME team adopted Mono?
A: Mono is too new to be adopted by those groups. We hope that the
tools that we will provide will be adopted by free software
programmers including the GNOME Foundation members and the GNOME
project generally.
Q: Should GNOME programmers switch over to Mono now?
A: It is still far to early for discussions of "switching over." No
pieces of Mono will be ready within the next six months, and a
complete implementation is roughly one year away.
We encourage GNOME developers to continue using the existing tools,
libraries and components. Improvements made to GNOME will have an
impact on Mono, as they would be the "back-end" for various classes.
Q: Will Mono include compatibility with Bonobo components? What is the
relationship between Mono and Bonobo?
A: Yes, we will provide a set of classes for implementing and using
Bonobo components from within Mono. Mono should allow you to write
Bonobo components more easily, just like .NET on Windows allows you
to export .NET components to COM.
Q: Does Mono depend on GNOME?
A: No, Mono does not depend on GNOME. We use a few packages produced by
the GNOME team like the `glib' library, we also use other
third-party open source libraries like Cairo and ICU.
Q: But will I be able to build GNOME applications?
A: Yes, we will enable people to write GNOME applications using Mono.
Q: Do you have C# bindings for GNOME?.
A: Yes, the <a href="http://gtk-sharp.sf.net">Gtk# project</a>
provides bindings for Gtk+, Gdk, Atk, libgnome, libgnomecanvas, and
libgnomeui. Other libraries under the GNOME framework will be
added on an as-needed (and as-requested) basis.
<a name="gui"></a>
** GUI applications
Q: Will Mono enable GUI applications to be authored?
A: Yes, you will be able to build GUI applications. Indeed, that is
our main focus. Today you can use Gtk# or #WT to develop GUI
applications, and support for Windows.Forms is underway.
Q: What is the difference between Gtk# and System.Windows.Forms?
A: Gtk# is a set of bindings for the Gtk+ toolkit for C# (and other
CIL-enabled languages), it integrates natively with the Gnome
desktop. System.Windows.Forms is an API defined by Microsoft to
build GUI applications.
Q: What are you using to implement Windows.Forms?
A: Windows.Forms is currently being implemented on top of a modified
version of Wine that can be used as a library: WineLib.
Essentially Wine is used as a library that happens to implement the
"Win32" toolkit and our Windows.Forms becomes a managed layer on
top of this toolkit.
There are several advantages in this approach: we get Wndproc
message compatibility for free (Wndproc is an overridable method in
the Control class and it is used to perform advanced tricks with
the GUI toolkit) as well as allowing third-party controls that are
used to P/Invoke into Win32 in the Windows world to work out of the
box on Linux/MacOS.
Q: Why not implement System.Windows.Forms on top of Gtk# or Qt#?
A: Compatibility.
Although it is possible to run simple Windows.Forms applications
with the Gtk#-based backend of Windows.Forms, it is very unlikely
that the implementation will ever implement everything needed for
full compatibility with Windows.Forms.
The reason is that Windows.Forms is not a complete toolkit, and to
work around this problem some of the underlying Win32 foundation is
exposed to the programmer in the form of exposing the Windows
message handler (WndProc). Any control can override this method.
Also developers often P/Invoke into Win32 to get to functionality
that was not wrapped.
To achieve full compatibility, we would have to emulate this, and
it would take too long.
For more details see the <a href="winforms.html">winforms page</a>
Q: Wine applications do not look like native applications, what are
you going to do about this?
A: We have already a few patches into our version of Windows.Forms
that makes Wine use the colors and font settings from your desktop,
improving the integration a lot. In the future, we will continue
to improve this interoperability scenario.
Q: Will I be able to run my smart clients on systems powered by Mono?
A: As long as your applications are 100% .NET and do not make use
of P/Invoke to call Win32 functions, your smart client applications
will run on Mono platforms.
Q: Where can I learn more about Gtk#?
A: The following <a href="http://gtk-sharp.sourceforge.net">link</a> sends you to the page of the project.
Q: What can I do with Gtk#?.
A: Gtk# is becoming very usable and you can create applications and
applets like those you see in a GNOME desktop environment. It's
easy to install so it's worth a try.
Q: How can I compile my HelloWorld.cs which uses Gtk#?.
A: Try: mcs -r:gtk-sharp HelloWorld.cs
Q: Is there any way how to connect DataAdapter to some GTK# controls?
A: There is a sample file called `DbClient' in gtk-sharp/samples that you
might to look at. It is a sample program in Gtk# that adds/updates/deletes
information on a Postgress database. When we have the new table/tree widgets,
I am sure someone would write an adapter for System.Data (in Gtk2 the
tree/list widgets are written using a view/model, so you only need to write
a model that maps to the database). You can have a look at
gtk-sharp/sample/DbClient, where there is a GTK# application that uses
System.Data. It does not use DataAdapter, but DataReader though.
Q: Do you have an estimate for when Windows.Forms will be released?
A: The plan currently is aimed at Q4/2004.
Q: Do you have a comparission chart about the various toolkit
offerings?
A: A document explaining this is available at: <a
href="http://primates.ximian.com/~miguel/toolkits.html">http://primates.ximian.com/~miguel/toolkits.html</a>.
<a name="msft"></a>
** Mono and Microsoft
Q: Is Microsoft helping Ximian with this project?
A: There is no high level communication between Ximian and Microsoft
at this point, but engineers who work on .NET or the ECMA groups
have been very friendly, and very nice to answer our questions, or
clarify part of the specification for us.
Microsoft is interested in other implementations of .NET and are
willing to help make the ECMA spec more accurate for this purpose.
Ximian was also invited to participate in the ECMA committee
meetings for C# and the CLI.
Q: Are Microsoft or Corel paying Ximian to do this?
A: No.
Q: Do you fear that Microsoft will change the spec and render Mono
useless?
A: No. Microsoft proved with the CLI and the C# language that it was
possible to create a powerful foundation for many languages to
inter-operate. We will always have that.
Even if changes happened in the platform which were undocumented,
the existing platform would a value on its own.
Q: Are you writing Mono from the ECMA specs?
A: Yes, we are writing them from the ECMA specs and the published
materials in print about .NET.
Q: If my applications use Mono, will I have to pay a service fee?
A: No. Mono is not related to Microsoft's initiative of
software-as-a-service.
Q: Is the Mono Project is related to the Microsoft Hailstorm effort? Is
Ximian endorsing Hailstorm?
A: No. The Mono Project is focused on providing a compatible set of
tools for the Microsoft .NET development platform. It does not
address, require, or otherwise endorse the MS Passport-based
Hailstorm single sign-on system that is part of Windows XP and
other services.
Q: Will Mono or .NET applications depend on Microsoft Passport?
A: No. MS Passport is unrelated to running .NET compatible applications
produced with the Mono tools. The only thing you will need is a
just-in-time compiler (JIT).
Q: If Microsoft will release a port of their .NET platform under the
`Shared Source' license, why should I bother with anything else?
A: The Shared Source implementation will be expensive and its uses
will be tightly restricted, especially for commercial use. We are
working towards an implementation that will grant a number of
important rights to recipients: use for any purpose,
redistribution, modification, and redistribution of modifications.
This is what we call <a
href="http://www.gnu.org/philosophy/free-sw.html">Free Software</a>
Q: Is Mono a free implementation of Passport?
A: No. Mono is just a runtime, a compiler and a set of class
libraries.
Q: Will the System.Web.Security.PassportIdentity class mean
that my software will depend on Passport?
A: No. Applications may use that API to contact a Passport site, but
are not required to do so.
As long as your application does not use Passport, you will not
need Passport.
Q: Will Mono running on Linux make Passport available for Linux?
A: No. However, the Passport toolkit for Linux-based web servers is
available from Microsoft.
Q: Will Mono allow me to run Microsoft Office on Linux?
A: No, it will not. Microsoft Office is a Windows application. To
learn more about running Windows applications on Intel Unix systems
refer to <a href="http://www.winehq.com">the Wine Project</a>.
Q: Can mono run the WebMatrix?
A: No. That requires System.Windows.Forms support which is not
currently implemented.
Q: Does mono have something like Passport?
Will mono have a server side Passport/Similar framework for XSP as well as client classes?
A: Not yet, but the client side API for authentication is not the problem.
We will likely have a lot of other authentication APIs, like the Liberty
Alliance APIs. The problem is people on the web provider end that might use
this for authentication.
<a name="platforms"></a>
** Mono Platforms
Q: What operating systems does Mono run on?
A: Mono is known to run on Linux, Unix and Windows systems.
Q: Can I run Mono applications without using `mono program.exe'?
A: Yes, this is possible on Linux systems, to do this, use something like:
<pre>
if [ ! -e /proc/sys/fs/binfmt_misc/register ]; then
/sbin/modprobe binfmt_misc
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
fi
if [ -e /proc/sys/fs/binfmt_misc/register ]; then
echo ':CLR:M::MZ::/usr/bin/mono:' > /proc/sys/fs/binfmt_misc/register
else
echo "No binfmt_misc support"
exit 1
fi
</pre>
Q: What architectures does Mono support?
A: Mono today ships with a Just-in-Time compiler for x86, PowerPC and
SPARC-based systems. It is tested regularly on Linux, FreeBSD and
Windows (with the XP/NT core).
There is also an interpreter, which is slower that runs on the
s390, SPARC, HPPA, StrongARM and PowerPC architectures.
Q: Can Mono run on Windows 9x, or ME editions?
A: Mono requires Unicode versions of Win32 APIs to run,
and only a handful of *W functions is supported under Win9x.
There is Microsoft Layer for Unicode that provides implementation
of these APIs on 9x systems.
Unfortunately it uses linker trick for delayed load that is not
supported by ld, so some sort of adapter is necessary.
You will need MSLU and one of the following libs to link Mono to
unicows.dll <a
href="http://mono.eurosoft.od.ua/files/unimono.zip">http://mono.eurosoft.od.ua/files/unimono.zip</a>
or alternatively search the net for "libunicows".
No changes to Mono source code required, the only thing is to make
sure that linker will resolve imports to adapter library instead of
Win32 libs. This is achieved by inserting -lunimono before
-lkerner32/user32 in the linker's specs file.
Q: Why support Windows, when you can run the real thing?
A: There are various reasons:
<ul>
<li> About half the contributors to Mono are Windows developers.
They have many different for contributing to the effort, and
we find it very important to let those developers run the runtime on Windows without forcing
them to use a new operating system.
<li> Supporting Windows helps us identify the portable portions
of Mono from the non-portable versions of it, helping Mono
become more portable in the future.
<li> Mono does not heavily modify the windows registry, update system DLLs,
install DLLs to the Windows/System32 path. Another words, I knew Mono would
not cause any legacy enterprise applications to stop working - and it
hasn't. However, our CIO er is againt it because of the changes that would
be made to Windows 2000, such as, affecting security.
</ul>
<a name="compatibility"></a>
** Compatibility
Q: Can Mono run applications developed with the Microsoft.NET framework?
A: Yes, Mono can run applications developed with the Microsoft .NET Framework
on Unix. There are a few caveats to keep in mind: Mono has not
been completed yet, so a few API calls might be missing; And in
some cases the Mono behavior *might* be incorrect.
Q: Will missing API entry points be implemented?
A: Yes, the goal of Mono is to implement precisely the .NET Framework
API (as well as compile-time selectable subsets, for those
interested in a lighter version of Mono).
Q: If the behavior of an API call is different, will you fix it?
A: Yes, we will. But we will need your assistance for this. If you find a bug
in the Mono implementation, please fill a bug report in <a
href="http://bugzilla.ximian.com">http://bugzilla.ximian.com</a>.
Do not assume we know about the problem, we might not, and using the bug tracking
system helps us organize the development process.
Q: Can I develop my applications on Windows, and deploy on a supported
Mono platform (like Linux)?
A: Yes, you can.
As of today, Mono is not 100% finished, so it is sometimes useful
to compile the code with Mono, to find out if your application
depends on unimplemented functionality.
Q: Will applications run out the box with Mono?
A: 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.
Q: What is a 100% .NET application?
A: 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
<tt>#-</tt> 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.
Q: Can I execute my Visual Studio .NET program (Visual Basic .NET, Visual C#,
Managed Extensions for C++, etc.) under Mono?
A: 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
<b>printf</b>(3) for example.), and you need to use
the linker options <tt>/nodefaultlib /entry:main mscoree.lib</tt> in
addition to the <tt>/clr</tt> compiler flag. You can still use certain
compiler intrinsic functions (such as <b>memcpy</b>(3)) and the STL.
You should also see <a
href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmex/html/vcgrfconvertingmanagedextensionsforcprojectsfrommixed-modetopureil.asp"
>Converting Managed Extensions for C++ Projects from Mixed Mode to Pure
Intermediate Language</a> 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.
<a name="pnpproject"></a>
** Mono and Portable.NET
Q: What are the differences between Mono and Portable.NET?
A: Most of Mono is being written using C#, with only
a few parts written in C (The JIT engine, the runtime, the
interfaces to the garbage collection system).
It is easier to describe what is unique about Mono:
<ul>
<li> An advanced native-code compilation engine: Both
just-in-time compilation (JIT) and pre-compilation of CIL
bytecodes into native code are supported.
<li> A foundation for code optimization: The new code generator in
Mono builds on the experience of our first JIT engine, and enables
us to implement various advanced compiler optimization
tricks. With an SSA-framework, plenty of new optimizations are possible.
The current list of optimizations are: Peephole postpass,
Branch optimizations, Inline method calls, Constant folding, Constant
propagation, Copy propagation, Dead code elimination, Linear scan
global reg allocation, Conditional moves, Emit per-domain code,
Instruction scheduling, Intrinsic method implementations, Tail
recursion and tail calls, Loop related optimizations, Fast x86 FP
compares, Leaf procedures optimizations
<li> A self-hosting C# compiler written in C#, which is clean, easy
to maintain.
<li> Focus on the .NET Framework: we are tracking down the .NET
Framework API definition, as we believe it is the API people
will be most familiar with.
<li> A multi-platform runtime engine: both a JIT engine and an
interpreter exist. The JIT engine runs currently on x86,
PowerPC Sparc and S390 systems, while the interpreter works on
x86, SPARC, StrongARM, s390 and PowerPC systems.
The JIT engine is being ported to amd64 systems as of this
time.
<li> Supports Linux, BSD, MacOS, Windows and Solaris at this point.
<li> The JIT engine is written using a portable instruction
selector which not only generates good code but
is also the foundation to re-target the JIT engine to other
systems.
<li> Full support for remoting in the runtime.
<li> The C# compiler, the JIT engine and the class libraries are
mature enough that the whole system has been self-hosting
since April 2002. This means that we develop Mono
completely with itself at this point.
By forcing ourselves to use our own code to develop our
tools, we bug fix problems rapidly, and the system is
overall more robust and tested than if we did not.
<li> Our class libraries are licensed under the terms of the MIT
X11 license which is a very liberal license as opposed to
the GNU GPL with exceptions, this means that Mono can be
used in places where the GPL with exceptions is not
permissible.
<li> Mono has a complete Web Services stack: we implement ASP.NET
web servers and web clients as well as implementing the
Remoting-based SOAP infrastructure.
<li> Remoting implementation: Mono has a complete remoting
infrastructure that is used in our own codebase to provide
added functionality and performance to our ASP.NET engine
and more.
<li> Mono has a complete <a href="c-sharp.html">C# 1.0</a>
implementation and has been stress tested a lot more than
Portable.NET's compiler.
<li> Mono's C# compiler has strong error handling and has closer
adherence to the specification with support for definite
assignment (required to generate verifiable IL code) and
CLS conformance checking.
<li> Mono's C# compiler is written in C# which is easier for new
developers to come in and improve, fix and tune. The Mono
C# compiler in C# is faster than their C-based compiler.
<li> Preview of C# 2.0: a work in progress for a 2.0
implementation of our compiler is available (iterators,
generics and anonymous methods are available in our
"preview" compiler).
<li> Mono has a complete Reflection and Reflection.Emit: these
are important for advanced applications, compilers and
dynamic code generation.
<li> Mono has a <a href="xml-classes.html">complete managed XML
stack</a>: XML, XPath, XML Serializer, XML Schema handling
are fully functional, feature complete and tuned for
performance.
<li> Mono has a <a href="crypto.html">complete cryptography stack
</a>: we implement the 1.0 and 1.1 APIs as well as using our
fully managed stack to implement the SSL/TLS transports.
<li> <a href="ado-net.html">Extensive database support</a>: Mono
ships with database provides for <a
href="firebird.html">Firebird</a>, <a href="ibmdb2.html">IBM
DB2</a>, <a href="oracle.html">Oracle</a>, <a
href="sybase.html">Sybase</a>, Microsoft <a
href="tdsclient.html">SQL Server</a>, <a
href="sqlite.html">SQL Lite</a>, <a
href="mysql.html">MySQL</a>, <a
href="postgresql.html">PostgresSQL</A>, <a href="oledb.html">Ole
DB</a> and <a href="odbc.html">ODBC</a>.
<li> Mono includes full LDAP support.
<li> We have a great community of developers, without which Mono
would not be possible.
</ul>
In general, Mono is more mature and complete since it has been used
to develop itself, which is a big motivator for stability and
correctness, while Portable.NET remains pretty much an untested
platform.
Q: I hear Mono keeps changing the P/Invoke API, why?
A: We are just fixing our implementation to be compatible with the
Microsoft implementation. In other words, the Mono P/Invoke API is
more complete when compared to the Portable.NET version, hence
various pieces of software that depend on this extended
functionality fail to work properly with Portable.NET.
<a name="webservices"></a>
** Web Services
Q: How is Mono related to Web Services?
A: Mono is only related to Web Services in that it will implement the
same set of classes that have been authored in the .NET Framework
to simplify and streamline the process of building Web Services.
But most importantly, Mono is an Open Source implementation of the
.NET Framework.
Q: Can I author Web Services with Mono?
A: You will be able to write Web Services on .NET that run on Mono and
vice-versa.
Q: If Mono implements the SDK classes, will I be able to write and
execute .NET Web Services with it?
A: Yes. When the project is finished, you will be able to use the
same technologies that are available through the .NET Framework SDK
on Windows to write Web Services.
Q: What about Soup? Can I use Soup without Mono?
A: Soup is a library for GNOME applications to create SOAP servers and
SOAP clients, and can be used without Mono. You can browse the
source code for soup using <a
href="http://cvs.gnome.org/bonsai/">GNOME's Bonsai</a>.
Q: Can I use CORBA?
A: Yes. The CLI contains enough information about a class that
exposing it to other RPC systems (like CORBA) is really simple, and
does not even require support from an object.
<a href="http://remoting-corba.sourceforge.net/">Remoting.CORBA</a> is
a CORBA implementation that is gaining momentum.
Building an implementation of the Bonobo interfaces once this is ready
should be relatively simple.
Q: Can I serialize my objects to other things other than XML?
A: Yes, although the serializing tools have not yet been planned, and
you would probably have to implement them yourself.
Q: Will Mono use ORBit?
A: There are a few advantages in using ORBit, like reusing existing code
and leveraging all the work done on it. Michael Meeks has posted
a few <a href="http://lists.ximian.com/archives/public/mono-list/2002-September/008592.html">reasons</a>,
as well as some <a href="http://lists.ximian.com/archives/public/mono-list/2002-September/008657.html">ideas</a>
that could be used to reuse ORBit.
Most users are likely to choose a native .NET solution, like <a href="http://cvs.gnome.org/bonsai">Remoting.CORBA</a>
<a name="monodoc"></a>
** MonoDoc
Q: What is MonoDoc?
A: MonoDoc is a graphical documentation browser for the Mono class
libraries. Currently, monodoc consists of a Gtk# application and is
in heavy development.
<a name="devel"></a>
** Development Tools and Issues
Q: I am having trouble compiling a new version of Mono from CVS, it
complains about my runtime being out of sync.
A: To upgrade your class libraries and compiler, see the
INSTALL.txt in the MCS directory.
The single biggest source of confusion seems to be the "Your
runtime is out of sync" messages. Realize that this is *normal*
while BUILDING. Think about it: you're building a new class
library with the old runtime. If the new class library references
a function that the old runtime knows nothing about, the runtime
system issues this warning.
Basically what needs to happen is for a new mono runtime to be
compiled, then the corlib class library be compiled, and once this
is done, install the new runtime, followed by corlib.
Once this is done, you can continue building your entire
environment.
For instance you just need to:
1.- Upgrade your Mono runtime (you might better do it with the
mono-build.sh script available in the <a
href="http://www.go-mono.com">download</a> page.
2.- Get the latest mono-lite tarball from the daily snapshots
<a href="http://www.go-mono.com/daily/">page</a>, unzip and
untar and copy all the dll files to your install path lib
directory (typically pointed by the $MONO_PATH variable).
Copy all the exe files to the install path bin directory.
3.- Then checkout or update your mcs CVS copy. Then follow
the steps described in mcs/INSTALL.txt.
Q: Will it be possible to use the CLI features without using byte codes or the JIT?
A: Yes. The CLI engine will be made available as a shared library.
The garbage collection engine, the threading abstraction, the
object system, the dynamic type code system and the JIT are
available for C developers to integrate with their applications if
they wish to do so.
Q: Will you have new development tools?
A: With any luck, Free Software enthusiasts will contribute tools to
improve the developer environment. These tools could be developed
initially using the Microsoft implementation of the CLI and then
executed later with Mono.
We are recommending people to use and contribute to existing
projects like SharpDevelop, Anjuta and Eclipse.
Q: What kind of rules make the Common Intermediate Language useful for
JITers?
A: The main rule is that the stack in the CLI is not a general purpose
stack. You are not allowed to use it for other purposes than
computing values and passing arguments to functions or return
values.
At any given call or return instruction, the types on the stack
have to be the same independently of the flow of execution of your
code.
Q: Is it true that the CIL is ideal for JITing and not efficient for
interpreters?
A: The CIL is better suited to be JITed than JVM byte codes, but you
can interpret them as trivially as you can interpret JVM byte
codes.
Q: Isn't it a little bit confusing to have the name of "XSP" (the same
as in the Apache Project) for the ASP.NET support in Mono?.
A: In Mono, xsp is just the name of the C# code generator for ASP.NET
pages. In the Apache Project, it is a term for the "eXtensible Server
Pages" technology so as they are very different things, they don't
conflict.
Q: Is there any plan to develop an aspx server for Mono?.
A: The XSP reference server is available and you can also use mod_mono
with Apache.
Q: Is there any way I can develop the class libraries using Linux yet?
A: Yes. Mono has been self hosting since May 2002.
Q: Is there any way I can install a known working copy of mono in /usr,
and an experimental copy somewhere else, and have both copies use
their own libraries? (I'm still not very good at library paths in
Linux)
A: Yes. Just use two installation prefixes.
Q: How should I write tests or a tests suite?
A: If you do a test suite for C#, you might want to keep it
independent of the Mono C# compiler, so that other compiler
implementations can later use it.
Q: Would it be too terrible to have another corlib signed as mscorlib?
A: We rename corlib to mscorlib also when saving the PE files, in fact,
the runtime can execute program created by mono just fine.