File: use_mono_mcs_common_compiler_infrastructure.patch

package info (click to toggle)
nant 0.92~rc1%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 11,212 kB
  • sloc: cs: 58,610; makefile: 97; xml: 75; cpp: 70
file content (919 lines) | stat: -rw-r--r-- 53,331 bytes parent folder | download | duplicates (2)
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
diff --git a/src/NAnt.Console/App.config b/src/NAnt.Console/App.config
index a3dc8ec..571ba23 100644
--- a/src/NAnt.Console/App.config
+++ b/src/NAnt.Console/App.config
@@ -1724,6 +1724,7 @@
                     </task-assemblies>
                     <tool-paths>
                         <directory name="${toolDirectory}" />
+                        <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.5')}" />
                         <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}" />
                         <!-- for compatibility with Mono 1.0.x -->
                         <directory name="${frameworkAssemblyDirectory}" />
@@ -1782,6 +1783,14 @@
                         <if test="${version::parse(mono.version) >= version::parse('1.2.3.50')}">
                             <property name="resgen.supportsexternalfilereferences" value="true" />
                         </if>
+                        <if test="${version::parse(mono.version) &lt; version::parse('3.0')}">
+                            <property name="csc.tool" value="gmcs"/>
+                            <property name="mcs.sdk" value="0"/>
+                        </if>
+                        <if test="${version::parse(mono.version) >= version::parse('3.0')}">
+                            <property name="csc.tool" value="mcs"/>
+                            <property name="mcs.sdk" value="2"/>
+                        </if>
 
                         <target name="configure-from-pkg-config">
                             <property name="mono.version" value="${pkg-config::get-mod-version('mono')}" />
@@ -1820,7 +1829,8 @@
                             <attribute name="managed">true</attribute>
                         </task>
                         <task name="csc">
-                            <attribute name="exename">gmcs</attribute>
+                            <attribute name="exename">${csc.tool}</attribute>
+                            <attribute name="mcssdk">${mcs.sdk}</attribute>
                             <attribute name="managed">true</attribute>
                             <attribute name="supportspackagereferences">true</attribute>
                             <attribute name="supportsnowarnlist">true</attribute>
@@ -1912,6 +1922,7 @@
                     </task-assemblies>
                     <tool-paths>
                         <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/3.5')}" />
+                        <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.5')}" />
                         <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}" />
                         <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}" />
                         <!-- unmanaged tools -->
@@ -1934,6 +1945,14 @@
 
                         <property name="toolDirectory" value="${path::combine(frameworkAssemblyDirectory, 'mono/3.5')}" />
                         <property name="runtimeEngine" value="${path::combine(sdkInstallRoot, 'bin/mono.exe')}" />
+                        <if test="${version::parse(mono.version) &lt; version::parse('3.0')}">
+                            <property name="csc.tool" value="gmcs"/>
+                            <property name="mcs.sdk" value="0"/>
+                        </if>
+                        <if test="${version::parse(mono.version) >= version::parse('3.0')}">
+                            <property name="csc.tool" value="mcs"/>
+                            <property name="mcs.sdk" value="2"/>
+                        </if>
 
                         <target name="configure-from-pkg-config">
                             <property name="mono.version" value="${pkg-config::get-mod-version('mono')}" />
@@ -1972,7 +1991,8 @@
                             <attribute name="managed">true</attribute>
                         </task>
                         <task name="csc">
-                            <attribute name="exename">gmcs</attribute>
+                            <attribute name="exename">${csc.tool}</attribute>
+                            <attribute name="mcssdk">${mcs.sdk}</attribute>
                             <attribute name="managed">true</attribute>
                             <attribute name="langversion">linq</attribute>
                             <attribute name="supportspackagereferences">true</attribute>
@@ -2067,6 +2087,7 @@
                     </task-assemblies>
                     <tool-paths>
                         <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.0')}" />
+                        <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.5')}" />
                         <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/3.5')}" />
                         <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}" />
                         <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}" />
@@ -2090,6 +2111,14 @@
 
                         <property name="toolDirectory" value="${path::combine(frameworkAssemblyDirectory, 'mono/4.0')}" />
                         <property name="runtimeEngine" value="${path::combine(sdkInstallRoot, 'bin/mono.exe')}" />
+                        <if test="${version::parse(mono.version) &lt; version::parse('3.0')}">
+                            <property name="csc.tool" value="dmcs"/>
+                            <property name="mcs.sdk" value="0"/>
+                        </if>
+                        <if test="${version::parse(mono.version) >= version::parse('3.0')}">
+                            <property name="csc.tool" value="mcs"/>
+                            <property name="mcs.sdk" value="4"/>
+                        </if>
 
                         <target name="configure-from-pkg-config">
                             <property name="mono.version" value="${pkg-config::get-mod-version('mono')}" />
@@ -2128,7 +2157,8 @@
                             <attribute name="managed">true</attribute>
                         </task>
                         <task name="csc">
-                            <attribute name="exename">dmcs</attribute>
+                            <attribute name="exename">${csc.tool}</attribute>
+                            <attribute name="mcssdk">${mcs.sdk}</attribute>
                             <attribute name="managed">true</attribute>
                             <attribute name="langversion">linq</attribute>
                             <attribute name="supportspackagereferences">true</attribute>
@@ -2212,6 +2242,7 @@
                     </task-assemblies>
                     <tool-paths>
                         <directory name="${toolDirectory}" />
+                        <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.5')}" />
                         <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}" />
                         <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}" />
                         <!-- unmanaged tools -->
@@ -2234,6 +2265,14 @@
 
                         <property name="toolDirectory" value="${path::combine(frameworkAssemblyDirectory, 'mono/2.1')}" />
                         <property name="runtimeEngine" value="${path::combine(sdkInstallRoot, 'bin/mono.exe')}" />
+                        <if test="${version::parse(mono.version) &lt; version::parse('3.0')}">
+                            <property name="csc.tool" value="smcs"/>
+                            <property name="mcs.sdk" value="0"/>
+                        </if>
+                        <if test="${version::parse(mono.version) >= version::parse('3.0')}">
+                            <property name="csc.tool" value="mcs"/>
+                            <property name="mcs.sdk" value="2.1"/>
+                        </if>
 
                         <target name="configure-from-pkg-config">
                             <property name="mono.version" value="${pkg-config::get-mod-version('mono')}" />
@@ -2267,7 +2306,8 @@
                     </project>
                     <tasks>
                         <task name="csc">
-                            <attribute name="exename">smcs</attribute>
+                            <attribute name="exename">${csc.tool}</attribute>
+                            <attribute name="mcssdk">${mcs.sdk}</attribute>
                             <attribute name="managed">true</attribute>
                             <attribute name="supportspackagereferences">true</attribute>
                             <attribute name="supportsnowarnlist">true</attribute>
@@ -2502,6 +2542,7 @@
                     </task-assemblies>
                     <tool-paths>
                         <directory name="${toolDirectory}" />
+                        <directory name="${path::combine(prefix, 'lib/mono/4.5')}" />
                         <directory name="${path::combine(prefix, 'lib/mono/1.0')}" />
                         <!-- unmanaged tools -->
                         <directory name="${prefix}/bin" />
@@ -2526,13 +2567,22 @@
                         <if test="${pkg-config::is-atleast-version('mono', '1.2.3.50')}">
                             <property name="resgen.supportsexternalfilereferences" value="true" />
                         </if>
+                        <if test="${not(pkg-config::is-atleast-version('mono', '3.0'))}">
+                            <property name="csc.tool" value="gmcs"/>
+                            <property name="mcs.sdk" value="0"/>
+                        </if>
+                        <if test="${pkg-config::is-atleast-version('mono', '3.0')}">
+                            <property name="csc.tool" value="mcs"/>
+                            <property name="mcs.sdk" value="2"/>
+                        </if>
                     </project>
                     <tasks>
                         <task name="al">
                             <attribute name="managed">true</attribute>
                         </task>
                         <task name="csc">
-                            <attribute name="exename">gmcs</attribute>
+                            <attribute name="exename">${csc.tool}</attribute>
+                            <attribute name="mcssdk">${mcs.sdk}</attribute>
                             <attribute name="managed">true</attribute>
                             <attribute name="supportspackagereferences">true</attribute>
                             <attribute name="supportsnowarnlist">true</attribute>
@@ -2616,6 +2666,7 @@
                     </task-assemblies>
                     <tool-paths>
                         <directory name="${toolDirectory}" />
+                        <directory name="${path::combine(prefix, 'lib/mono/4.5')}" />
                         <directory name="${path::combine(prefix, 'lib/mono/2.0')}" />
                         <directory name="${path::combine(prefix, 'lib/mono/1.0')}" />
                         <!-- unmanaged tools -->
@@ -2628,13 +2679,22 @@
                         <property name="resgen.supportsexternalfilereferences" value="false" />
                         <property name="prefix" value="${pkg-config::get-variable('mono', 'prefix')}" />
                         <property name="toolDirectory" value="${path::combine(prefix, 'lib/mono/3.5')}" />
+                        <if test="${not(pkg-config::is-atleast-version('mono', '3.0'))}">
+                            <property name="csc.tool" value="gmcs"/>
+                            <property name="mcs.sdk" value="0"/>
+                        </if>
+                        <if test="${pkg-config::is-atleast-version('mono', '3.0')}">
+                            <property name="csc.tool" value="mcs"/>
+                            <property name="mcs.sdk" value="2"/>
+                        </if>
                     </project>
                     <tasks>
                         <task name="al">
                             <attribute name="managed">true</attribute>
                         </task>
                         <task name="csc">
-                            <attribute name="exename">gmcs</attribute>
+                            <attribute name="exename">${csc.tool}</attribute>
+                            <attribute name="mcssdk">${mcs.sdk}</attribute>
                             <attribute name="managed">true</attribute>
                             <attribute name="langversion">linq</attribute>
                             <attribute name="supportspackagereferences">true</attribute>
@@ -2721,6 +2781,7 @@
                     </task-assemblies>
                     <tool-paths>
                         <directory name="${toolDirectory}" />
+                        <directory name="${path::combine(prefix, 'lib/mono/4.5')}" />
                         <directory name="${path::combine(prefix, 'lib/mono/3.5')}" />
                         <directory name="${path::combine(prefix, 'lib/mono/2.0')}" />
                         <directory name="${path::combine(prefix, 'lib/mono/1.0')}" />
@@ -2734,13 +2795,22 @@
                         <property name="resgen.supportsexternalfilereferences" value="false" />
                         <property name="prefix" value="${pkg-config::get-variable('mono', 'prefix')}" />
                         <property name="toolDirectory" value="${path::combine(prefix, 'lib/mono/4.0')}" />
+                        <if test="${not(pkg-config::is-atleast-version('mono', '3.0'))}">
+                            <property name="csc.tool" value="dmcs"/>
+                            <property name="mcs.sdk" value="0"/>
+                        </if>
+                        <if test="${pkg-config::is-atleast-version('mono', '3.0')}">
+                            <property name="csc.tool" value="mcs"/>
+                            <property name="mcs.sdk" value="4"/>
+                        </if>
                     </project>
                     <tasks>
                         <task name="al">
                             <attribute name="managed">true</attribute>
                         </task>
                         <task name="csc">
-                            <attribute name="exename">dmcs</attribute>
+                            <attribute name="exename">${csc.tool}</attribute>
+                            <attribute name="mcssdk">${mcs.sdk}</attribute>
                             <attribute name="managed">true</attribute>
                             <attribute name="langversion">linq</attribute>
                             <attribute name="supportspackagereferences">true</attribute>
@@ -2824,6 +2894,7 @@
                     </task-assemblies>
                     <tool-paths>
                         <directory name="${toolDirectory}" />
+                        <directory name="${path::combine(prefix, 'lib/mono/4.5')}" />
                         <directory name="${path::combine(prefix, 'lib/mono/2.0')}" />
                         <directory name="${path::combine(prefix, 'lib/mono/1.0')}" />
                         <!-- unmanaged tools -->
@@ -2835,10 +2906,19 @@
                         </if>
                         <property name="prefix" value="${pkg-config::get-variable('mono', 'prefix')}" />
                         <property name="toolDirectory" value="${path::combine(prefix, 'lib/mono/2.1')}" />
+                        <if test="${not(pkg-config::is-atleast-version('mono', '3.0'))}">
+                            <property name="csc.tool" value="smcs"/>
+                            <property name="mcs.sdk" value="0"/>
+                        </if>
+                        <if test="${pkg-config::is-atleast-version('mono', '3.0')}">
+                            <property name="csc.tool" value="mcs"/>
+                            <property name="mcs.sdk" value="2.1"/>
+                        </if>
                     </project>
                     <tasks>
                         <task name="csc">
-                            <attribute name="exename">smcs</attribute>
+                            <attribute name="exename">${csc.tool}</attribute>
+                            <attribute name="mcssdk">${mcs.sdk}</attribute>
                             <attribute name="managed">true</attribute>
                             <attribute name="supportspackagereferences">true</attribute>
                             <attribute name="supportsnowarnlist">true</attribute>
diff --git a/src/NAnt.Core/ConsoleDriver.cs b/src/NAnt.Core/ConsoleDriver.cs
old mode 100644
new mode 100755
index 454600c..2d1a6d9
--- a/src/NAnt.Core/ConsoleDriver.cs
+++ b/src/NAnt.Core/ConsoleDriver.cs
@@ -318,8 +318,9 @@ namespace NAnt.Core {
             xsltDoc.Load(reader);
             xsltDoc.DocumentElement.SetAttribute("xmlns:nant",buildDoc.DocumentElement.NamespaceURI);
 
-            XslTransform transform = new XslTransform();
-            transform.Load(xsltDoc);
+            XslCompiledTransform transform = new XslCompiledTransform();
+            XsltSettings settings = new XsltSettings(false, true);
+            transform.Load(xsltDoc, settings, new XmlUrlResolver());
 
             StringBuilder sb = new StringBuilder();
             StringWriter writer = new StringWriter(sb, CultureInfo.InvariantCulture);
diff --git a/src/NAnt.Core/Resources/ProjectHelp.xslt b/src/NAnt.Core/Resources/ProjectHelp.xslt
old mode 100644
new mode 100755
index 04756d9..e180bcd
--- a/src/NAnt.Core/Resources/ProjectHelp.xslt
+++ b/src/NAnt.Core/Resources/ProjectHelp.xslt
@@ -26,7 +26,7 @@
     <xslt:output method="text" />
     <msxsl:script language="C#" implements-prefix="stringutils">
     <![CDATA[
-        string PadRight( string str, int padding) {
+        public string PadRight( string str, int padding) {
             return str.PadRight(padding);
         }
     ]]>
diff --git a/src/NAnt.DotNet/Tasks/CscTask.cs b/src/NAnt.DotNet/Tasks/CscTask.cs
index 31b1a0a..b0ad97b 100644
--- a/src/NAnt.DotNet/Tasks/CscTask.cs
+++ b/src/NAnt.DotNet/Tasks/CscTask.cs
@@ -90,6 +90,7 @@ namespace NAnt.DotNet.Tasks {
         private string _langVersion;
 
         // framework configuration settings
+        private double _mcsSdk = 0;
         private bool _supportsDocGeneration = true;
         private bool _supportsPlatform;
         private bool _supportsLangVersion;
@@ -362,6 +363,21 @@ namespace NAnt.DotNet.Tasks {
 
         #endregion Public Instance Properties
 
+        #region Protected Instance Properties
+
+        /// <summary>
+        /// Gets or sets the mcs sdk version to apply to the new mcs compiler
+        /// for Mono 3.0+
+        /// </summary>
+        [FrameworkConfigurable("mcssdk")]
+        protected double McsSdk 
+        {
+            get { return _mcsSdk; }
+            set { _mcsSdk = value; }
+        }
+
+        #endregion Protected Instance Properties
+
         #region Override implementation of CompilerBase
 
         /// <summary>
@@ -378,6 +394,16 @@ namespace NAnt.DotNet.Tasks {
                 WriteOption(writer, "baseaddress", BaseAddress);
             }
 
+            // If mcs is the compiler and the specified McsSdk version is specified, append the new
+            // -sdk: option to the argument list.
+            if (PlatformHelper.IsMono) 
+            {
+                if (ExeName.Equals("mcs", StringComparison.InvariantCultureIgnoreCase) && _mcsSdk > 0) 
+                {
+                    WriteOption(writer, "sdk", _mcsSdk.ToString());
+                }
+            }
+
             // XML documentation
             if (DocFile != null) {
                 if (SupportsDocGeneration) {
diff --git a/src/NAnt.NUnit/NAnt.NUnit.build b/src/NAnt.NUnit/NAnt.NUnit.build
index f4aba89..9695e24 100644
--- a/src/NAnt.NUnit/NAnt.NUnit.build
+++ b/src/NAnt.NUnit/NAnt.NUnit.build
@@ -42,6 +42,8 @@
         </csc>
         <csc target="library" define="${current.build.defines}" warnaserror="${build.warnaserror}" debug="${build.debug}" output="${build.dir}/bin/NAnt.NUnit2Tasks.dll" doc="${build.dir}/bin/NAnt.NUnit2Tasks.xml">
             <nowarn>
+                <!-- do not report obsolete warnings until XslCompiledTransform works with NUnit2 output -->
+                <warning number="0612" />
                 <!-- do not report deprecation warnings -->
                 <warning number="0618" />
             </nowarn>
diff --git a/src/NDoc.Documenter.NAnt/NDoc.Documenter.NAnt.build b/src/NDoc.Documenter.NAnt/NDoc.Documenter.NAnt.build
index f7e3055..2de6374 100644
--- a/src/NDoc.Documenter.NAnt/NDoc.Documenter.NAnt.build
+++ b/src/NDoc.Documenter.NAnt/NDoc.Documenter.NAnt.build
@@ -11,6 +11,7 @@
         <!-- build main assembly -->
         <csc target="library" define="${current.build.defines}" warnaserror="${build.warnaserror}" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.dll" doc="${build.dir}/bin/${project::get-name()}.xml">
             <nowarn>
+                <warning number="0612" />
                 <warning number="0618" />
                 <warning number="1591" />
                 <warning number="1572" />
diff --git a/tests/NAnt.Core/Framework.config b/tests/NAnt.Core/Framework.config
old mode 100644
new mode 100755
index 62e64ea..319940a
--- a/tests/NAnt.Core/Framework.config
+++ b/tests/NAnt.Core/Framework.config
@@ -467,28 +467,6 @@
                         key="SOFTWARE\Microsoft\.NETFramework\InstallRoot"
                         hive="LocalMachine" />
                     <locatesdk property="sdkInstallRoot" minwinsdkver="v6.0A" maxnetfxver="3.5" failonerror="false" />
-                    <!--
-                    <readregistry
-                        property="sdkInstallRoot"
-                        key="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A\WinSDKNetFxTools\InstallationFolder"
-                        hive="LocalMachine"
-                        failonerror="false" />
-                    <readregistry
-                        property="sdkInstallRoot"
-                        key="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.1\InstallationFolder"
-                        hive="LocalMachine"
-                        failonerror="false" />
-                    <readregistry
-                        property="sdkInstallRoot"
-                        key="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0\InstallationFolder"
-                        hive="LocalMachine"
-                        failonerror="false" />
-                    <readregistry
-                        property="sdkInstallRoot"
-                        key="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\InstallationFolder"
-                        hive="LocalMachine"
-                        failonerror="false" />
-                    -->
                 </project>
                 <tasks>
                     <task name="csc">
@@ -792,19 +770,6 @@
                         key="SOFTWARE\Microsoft\.NETFramework\InstallRoot"
                         hive="LocalMachine" />
                     <locatesdk property="sdkInstallRoot" minwinsdkver="v7.0A" minnetfxver="4.0" maxnetfxver="4.0.99999" failonerror="false" />
-                    <!--
-                    <echo message="sdkInstallRoot=${sdkInstallRoot}" if="${property::exists('sdkInstallRoot')}" />
-                    <readregistry
-                        property="sdkInstallRoot"
-                        key="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools\InstallationFolder"
-                        hive="LocalMachine"
-                        failonerror="false" />
-                    <readregistry
-                        property="sdkInstallRoot"
-                        key="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools-x86\InstallationFolder"
-                        hive="LocalMachine"
-                        failonerror="false" />
-                    -->
                 </project>
                 <tasks>
                     <task name="csc">
@@ -1302,9 +1267,12 @@
                 </task-assemblies>
                 <tool-paths>
                     <directory name="${toolDirectory}" />
+                    <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.5')}" />
                     <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}" />
                     <!-- for compatibility with Mono 1.0.x -->
                     <directory name="${frameworkAssemblyDirectory}" />
+                    <!-- unmanaged tools -->
+                    <directory name="${sdkInstallRoot}/bin" />
                 </tool-paths>
                 <project>
                     <!-- quick and dirty check to see if pkg-config is available (and configured) -->
@@ -1320,26 +1288,30 @@
                     <if test="${not pkgconfig.available}">
                         <call target="configure-from-registry" />
                     </if>
+
                     <property name="resgen.supportsexternalfilereferences" value="false" />
+
                     <!-- determine if we're dealing with a Mono 1.0.x release -->
                     <if test="${version::parse(mono.version) &lt; version::parse('1.1')}">
                         <!-- 
-                                in Mono 1.0.x, the framework tools are located 
-                                in the <install root>\lib directory, except for
-                                mbas and mcs
-                            -->
+                            in Mono 1.0.x, the framework tools are located 
+                            in the <install root>\lib directory, except for
+                            mbas and mcs
+                        -->
                         <property name="toolDirectory" value="${frameworkAssemblyDirectory}" />
                         <property name="runtimeEngine" value="${path::combine(frameworkAssemblyDirectory, 'mono.exe')}" />
                         <property name="resgen.tool" value="monoresgen" />
                         <property name="csc.supportsdocgeneration" value="false" />
+
                         <!-- 
-                                Mono 1.0.1 installer incorrectly adds '\mono' to 
-                                "MonoConfigDir" registry value
-                            -->
+                            Mono 1.0.1 installer incorrectly adds '\mono' to 
+                            "MonoConfigDir" registry value
+                        -->
                         <if test="${string::ends-with(configDir, 'etc\mono')}">
                             <property name="configDir" value="${string::replace(configDir, 'etc\mono', 'etc')}" />
                         </if>
                     </if>
+
                     <!-- determine if we're dealing with a Mono 1.1.x release or higher -->
                     <if test="${version::parse(mono.version) >= version::parse('1.1')}">
                         <property name="toolDirectory" value="${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}" />
@@ -1354,28 +1326,54 @@
                     <if test="${version::parse(mono.version) >= version::parse('1.2.3.50')}">
                         <property name="resgen.supportsexternalfilereferences" value="true" />
                     </if>
+                    <if test="${version::parse(mono.version) &lt; version::parse('3.0')}">
+                        <property name="csc.tool" value="gmcs"/>
+                        <property name="mcs.sdk" value="0"/>
+                    </if>
+                    <if test="${version::parse(mono.version) >= version::parse('3.0')}">
+                        <property name="csc.tool" value="mcs"/>
+                        <property name="mcs.sdk" value="2"/>
+                    </if>
+
                     <target name="configure-from-pkg-config">
                         <property name="mono.version" value="${pkg-config::get-mod-version('mono')}" />
                         <property name="sdkInstallRoot" value="${cygpath::get-windows-path(pkg-config::get-variable('mono', 'prefix'))}" />
                         <property name="frameworkAssemblyDirectory" value="${cygpath::get-windows-path(pkg-config::get-variable('mono', 'libdir'))}" />
                         <property name="configDir" value="${path::combine(sdkInstallRoot, 'etc')}/" />
                     </target>
+
                     <target name="configure-from-registry">
-                        <readregistry property="mono.version" key="SOFTWARE\Novell\Mono\DefaultCLR" hive="LocalMachine" />
-                        <property name="monokey" value="SOFTWARE\Novell\Mono\${mono.version}" />
-                        <readregistry property="sdkInstallRoot" key="${monokey}\SdkInstallRoot" hive="LocalMachine" />
-                        <readregistry property="frameworkAssemblyDirectory" key="${monokey}\FrameworkAssemblyDirectory"
+                        <monoregistry property="mono.reg" failonerror="false" />
+                        <readregistry
+                            property="mono.version"
+                            key="${mono.reg}\DefaultCLR"
+                            hive="LocalMachine"
+                        />
+                        <property name="monokey" value="${mono.reg}\${mono.version}" />
+
+                        <readregistry
+                            property="sdkInstallRoot"
+                            key="${monokey}\SdkInstallRoot"
+                            hive="LocalMachine" />
+                        <readregistry
+                            property="frameworkAssemblyDirectory"
+                            key="${monokey}\FrameworkAssemblyDirectory"
+                            hive="LocalMachine" />
+                        <readregistry
+                            property="configDir"
+                            key="${monokey}\MonoConfigDir"
                             hive="LocalMachine" />
-                        <readregistry property="configDir" key="${monokey}\MonoConfigDir" hive="LocalMachine" />
                     </target>
                 </project>
-                <properties></properties>
+                <properties>
+                </properties>
                 <tasks>
                     <task name="al">
                         <attribute name="managed">true</attribute>
                     </task>
                     <task name="csc">
-                        <attribute name="exename">gmcs</attribute>
+                        <attribute name="exename">${csc.tool}</attribute>
+                        <attribute name="mcssdk">${mcs.sdk}</attribute>
                         <attribute name="managed">true</attribute>
                         <attribute name="supportspackagereferences">true</attribute>
                         <attribute name="supportsnowarnlist">true</attribute>
@@ -1467,8 +1465,11 @@
                 </task-assemblies>
                 <tool-paths>
                     <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/3.5')}" />
+                    <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.5')}" />
                     <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}" />
                     <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}" />
+                    <!-- unmanaged tools -->
+                    <directory name="${sdkInstallRoot}/bin" />
                 </tool-paths>
                 <project>
                     <!-- quick and dirty check to see if pkg-config is available (and configured) -->
@@ -1484,30 +1485,57 @@
                     <if test="${not pkgconfig.available}">
                         <call target="configure-from-registry" />
                     </if>
+
                     <property name="toolDirectory" value="${path::combine(frameworkAssemblyDirectory, 'mono/3.5')}" />
                     <property name="runtimeEngine" value="${path::combine(sdkInstallRoot, 'bin/mono.exe')}" />
+                    <if test="${version::parse(mono.version) &lt; version::parse('3.0')}">
+                        <property name="csc.tool" value="gmcs"/>
+                        <property name="mcs.sdk" value="0"/>
+                    </if>
+                    <if test="${version::parse(mono.version) >= version::parse('3.0')}">
+                        <property name="csc.tool" value="mcs"/>
+                        <property name="mcs.sdk" value="2"/>
+                    </if>
+
                     <target name="configure-from-pkg-config">
                         <property name="mono.version" value="${pkg-config::get-mod-version('mono')}" />
                         <property name="sdkInstallRoot" value="${cygpath::get-windows-path(pkg-config::get-variable('mono', 'prefix'))}" />
                         <property name="frameworkAssemblyDirectory" value="${cygpath::get-windows-path(pkg-config::get-variable('mono', 'libdir'))}" />
                         <property name="configDir" value="${path::combine(sdkInstallRoot, 'etc')}/" />
                     </target>
+
                     <target name="configure-from-registry">
-                        <readregistry property="mono.version" key="SOFTWARE\Novell\Mono\DefaultCLR" hive="LocalMachine" />
-                        <property name="monokey" value="SOFTWARE\Novell\Mono\${mono.version}" />
-                        <readregistry property="sdkInstallRoot" key="${monokey}\SdkInstallRoot" hive="LocalMachine" />
-                        <readregistry property="frameworkAssemblyDirectory" key="${monokey}\FrameworkAssemblyDirectory"
+                        <monoregistry property="mono.reg" failonerror="false" />
+                        <readregistry
+                            property="mono.version"
+                            key="${mono.reg}\DefaultCLR"
+                            hive="LocalMachine"
+                        />
+                        <property name="monokey" value="${mono.reg}\${mono.version}" />
+                       
+                        <readregistry
+                            property="sdkInstallRoot"
+                            key="${monokey}\SdkInstallRoot"
+                            hive="LocalMachine" />
+                        <readregistry
+                            property="frameworkAssemblyDirectory"
+                            key="${monokey}\FrameworkAssemblyDirectory"
+                            hive="LocalMachine" />
+                        <readregistry
+                            property="configDir"
+                            key="${monokey}\MonoConfigDir"
                             hive="LocalMachine" />
-                        <readregistry property="configDir" key="${monokey}\MonoConfigDir" hive="LocalMachine" />
                     </target>
                 </project>
-                <properties></properties>
+                <properties>
+                </properties>
                 <tasks>
                     <task name="al">
                         <attribute name="managed">true</attribute>
                     </task>
                     <task name="csc">
-                        <attribute name="exename">gmcs</attribute>
+                        <attribute name="exename">${csc.tool}</attribute>
+                        <attribute name="mcssdk">${mcs.sdk}</attribute>
                         <attribute name="managed">true</attribute>
                         <attribute name="langversion">linq</attribute>
                         <attribute name="supportspackagereferences">true</attribute>
@@ -1602,6 +1630,7 @@
                 </task-assemblies>
                 <tool-paths>
                     <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.0')}" />
+                    <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.5')}" />
                     <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/3.5')}" />
                     <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}" />
                     <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}" />
@@ -1625,6 +1654,14 @@
 
                     <property name="toolDirectory" value="${path::combine(frameworkAssemblyDirectory, 'mono/4.0')}" />
                     <property name="runtimeEngine" value="${path::combine(sdkInstallRoot, 'bin/mono.exe')}" />
+                    <if test="${version::parse(mono.version) &lt; version::parse('3.0')}">
+                        <property name="csc.tool" value="dmcs"/>
+                        <property name="mcs.sdk" value="0"/>
+                    </if>
+                    <if test="${version::parse(mono.version) >= version::parse('3.0')}">
+                        <property name="csc.tool" value="mcs"/>
+                        <property name="mcs.sdk" value="4"/>
+                    </if>
 
                     <target name="configure-from-pkg-config">
                         <property name="mono.version" value="${pkg-config::get-mod-version('mono')}" />
@@ -1663,7 +1700,8 @@
                         <attribute name="managed">true</attribute>
                     </task>
                     <task name="csc">
-                        <attribute name="exename">dmcs</attribute>
+                        <attribute name="exename">${csc.tool}</attribute>
+                        <attribute name="mcssdk">${mcs.sdk}</attribute>
                         <attribute name="managed">true</attribute>
                         <attribute name="langversion">linq</attribute>
                         <attribute name="supportspackagereferences">true</attribute>
@@ -1699,7 +1737,7 @@
                 </tasks>
             </framework>
             <framework
-                name="moonlight-2.0"
+                name="moonlight-2.0" 
                 family="moonlight"
                 version="2.0"
                 description="Moonlight 2.0"
@@ -1720,14 +1758,18 @@
                         </auto>
                     </modes>
                 </runtime>
-                <reference-assemblies basedir="${path::combine(prefix, 'lib/mono/2.1')}">
-                    <include name="agclr.dll" />
+                <reference-assemblies basedir="${path::combine(frameworkAssemblyDirectory, 'lib/mono/2.1')}">
                     <include name="Microsoft.VisualBasic.dll" />
                     <include name="mscorlib.dll" />
                     <include name="System.Core.dll" />
                     <include name="System.dll" />
-                    <include name="System.Silverlight.dll" />
-                    <include name="System.Xml.Core.dll" />
+                    <include name="System.Net.dll" />
+                    <include name="System.Runtime.Serialization.dll" />
+                    <include name="System.ServiceModel.dll" />
+                    <include name="System.ServiceModel.Web.dll" />
+                    <include name="System.Windows.Browser.dll" />
+                    <include name="System.Windows.dll" />
+                    <include name="System.Xml.dll" />
                 </reference-assemblies>
                 <task-assemblies>
                     <!-- include MS.NET version-neutral assemblies -->
@@ -1743,8 +1785,11 @@
                 </task-assemblies>
                 <tool-paths>
                     <directory name="${toolDirectory}" />
+                    <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.5')}" />
                     <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}" />
                     <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}" />
+                    <!-- unmanaged tools -->
+                    <directory name="${sdkInstallRoot}/bin" />
                 </tool-paths>
                 <project>
                     <!-- quick and dirty check to see if pkg-config is available (and configured) -->
@@ -1760,26 +1805,52 @@
                     <if test="${not pkgconfig.available}">
                         <call target="configure-from-registry" />
                     </if>
+
                     <property name="toolDirectory" value="${path::combine(frameworkAssemblyDirectory, 'mono/2.1')}" />
                     <property name="runtimeEngine" value="${path::combine(sdkInstallRoot, 'bin/mono.exe')}" />
+                    <if test="${version::parse(mono.version) &lt; version::parse('3.0')}">
+                        <property name="csc.tool" value="smcs"/>
+                        <property name="mcs.sdk" value="0"/>
+                    </if>
+                    <if test="${version::parse(mono.version) >= version::parse('3.0')}">
+                        <property name="csc.tool" value="mcs"/>
+                        <property name="mcs.sdk" value="2.1"/>
+                    </if>
+
                     <target name="configure-from-pkg-config">
                         <property name="mono.version" value="${pkg-config::get-mod-version('mono')}" />
                         <property name="sdkInstallRoot" value="${cygpath::get-windows-path(pkg-config::get-variable('mono', 'prefix'))}" />
                         <property name="frameworkAssemblyDirectory" value="${cygpath::get-windows-path(pkg-config::get-variable('mono', 'libdir'))}" />
                         <property name="configDir" value="${path::combine(sdkInstallRoot, 'etc')}/" />
                     </target>
+
                     <target name="configure-from-registry">
-                        <readregistry property="mono.version" key="SOFTWARE\Novell\Mono\DefaultCLR" hive="LocalMachine" />
-                        <property name="monokey" value="SOFTWARE\Novell\Mono\${mono.version}" />
-                        <readregistry property="sdkInstallRoot" key="${monokey}\SdkInstallRoot" hive="LocalMachine" />
-                        <readregistry property="frameworkAssemblyDirectory" key="${monokey}\FrameworkAssemblyDirectory"
+                        <monoregistry property="mono.reg" failonerror="false" />
+                        <readregistry
+                            property="mono.version"
+                            key="${mono.reg}\DefaultCLR"
+                            hive="LocalMachine"
+                        />
+                        <property name="monokey" value="${mono.reg}\${mono.version}" />
+
+                        <readregistry
+                            property="sdkInstallRoot"
+                            key="${monokey}\SdkInstallRoot"
+                            hive="LocalMachine" />
+                        <readregistry
+                            property="frameworkAssemblyDirectory"
+                            key="${monokey}\FrameworkAssemblyDirectory"
+                            hive="LocalMachine" />
+                        <readregistry
+                            property="configDir"
+                            key="${monokey}\MonoConfigDir"
                             hive="LocalMachine" />
-                        <readregistry property="configDir" key="${monokey}\MonoConfigDir" hive="LocalMachine" />
                     </target>
                 </project>
                 <tasks>
                     <task name="csc">
-                        <attribute name="exename">smcs</attribute>
+                        <attribute name="exename">${csc.tool}</attribute>
+                        <attribute name="mcssdk">${mcs.sdk}</attribute>
                         <attribute name="managed">true</attribute>
                         <attribute name="supportspackagereferences">true</attribute>
                         <attribute name="supportsnowarnlist">true</attribute>
@@ -2037,7 +2108,10 @@
                 </task-assemblies>
                 <tool-paths>
                     <directory name="${toolDirectory}" />
+                    <directory name="${path::combine(prefix, 'lib/mono/4.5')}" />
                     <directory name="${path::combine(prefix, 'lib/mono/1.0')}" />
+                    <!-- unmanaged tools -->
+                    <directory name="${prefix}/bin" />
                 </tool-paths>
                 <project>
                     <if test="${not pkg-config::exists('mono')}">
@@ -2059,13 +2133,22 @@
                     <if test="${pkg-config::is-atleast-version('mono', '1.2.3.50')}">
                         <property name="resgen.supportsexternalfilereferences" value="true" />
                     </if>
+                    <if test="${not(pkg-config::is-atleast-version('mono', '3.0'))}">
+                        <property name="csc.tool" value="gmcs"/>
+                        <property name="mcs.sdk" value="0"/>
+                    </if>
+                    <if test="${pkg-config::is-atleast-version('mono', '3.0')}">
+                        <property name="csc.tool" value="mcs"/>
+                        <property name="mcs.sdk" value="2"/>
+                    </if>
                 </project>
                 <tasks>
                     <task name="al">
                         <attribute name="managed">true</attribute>
                     </task>
                     <task name="csc">
-                        <attribute name="exename">gmcs</attribute>
+                        <attribute name="exename">${csc.tool}</attribute>
+                        <attribute name="mcssdk">${mcs.sdk}</attribute>
                         <attribute name="managed">true</attribute>
                         <attribute name="supportspackagereferences">true</attribute>
                         <attribute name="supportsnowarnlist">true</attribute>
@@ -2149,8 +2232,11 @@
                 </task-assemblies>
                 <tool-paths>
                     <directory name="${toolDirectory}" />
+                    <directory name="${path::combine(prefix, 'lib/mono/4.5')}" />
                     <directory name="${path::combine(prefix, 'lib/mono/2.0')}" />
                     <directory name="${path::combine(prefix, 'lib/mono/1.0')}" />
+                    <!-- unmanaged tools -->
+                    <directory name="${prefix}/bin" />
                 </tool-paths>
                 <project>
                     <if test="${not pkg-config::exists('mono')}">
@@ -2159,13 +2245,22 @@
                     <property name="resgen.supportsexternalfilereferences" value="false" />
                     <property name="prefix" value="${pkg-config::get-variable('mono', 'prefix')}" />
                     <property name="toolDirectory" value="${path::combine(prefix, 'lib/mono/3.5')}" />
+                    <if test="${not(pkg-config::is-atleast-version('mono', '3.0'))}">
+                        <property name="csc.tool" value="gmcs"/>
+                        <property name="mcs.sdk" value="0"/>
+                    </if>
+                    <if test="${pkg-config::is-atleast-version('mono', '3.0')}">
+                        <property name="csc.tool" value="mcs"/>
+                        <property name="mcs.sdk" value="2"/>
+                    </if>
                 </project>
                 <tasks>
                     <task name="al">
                         <attribute name="managed">true</attribute>
                     </task>
                     <task name="csc">
-                        <attribute name="exename">gmcs</attribute>
+                        <attribute name="exename">${csc.tool}</attribute>
+                        <attribute name="mcssdk">${mcs.sdk}</attribute>
                         <attribute name="managed">true</attribute>
                         <attribute name="langversion">linq</attribute>
                         <attribute name="supportspackagereferences">true</attribute>
@@ -2252,6 +2347,7 @@
                 </task-assemblies>
                 <tool-paths>
                     <directory name="${toolDirectory}" />
+                    <directory name="${path::combine(prefix, 'lib/mono/4.5')}" />
                     <directory name="${path::combine(prefix, 'lib/mono/3.5')}" />
                     <directory name="${path::combine(prefix, 'lib/mono/2.0')}" />
                     <directory name="${path::combine(prefix, 'lib/mono/1.0')}" />
@@ -2265,13 +2361,22 @@
                     <property name="resgen.supportsexternalfilereferences" value="false" />
                     <property name="prefix" value="${pkg-config::get-variable('mono', 'prefix')}" />
                     <property name="toolDirectory" value="${path::combine(prefix, 'lib/mono/4.0')}" />
+                    <if test="${not(pkg-config::is-atleast-version('mono', '3.0'))}">
+                        <property name="csc.tool" value="dmcs"/>
+                        <property name="mcs.sdk" value="0"/>
+                    </if>
+                    <if test="${pkg-config::is-atleast-version('mono', '3.0')}">
+                        <property name="csc.tool" value="mcs"/>
+                        <property name="mcs.sdk" value="4"/>
+                    </if>
                 </project>
                 <tasks>
                     <task name="al">
                         <attribute name="managed">true</attribute>
                     </task>
                     <task name="csc">
-                        <attribute name="exename">dmcs</attribute>
+                        <attribute name="exename">${csc.tool}</attribute>
+                        <attribute name="mcssdk">${mcs.sdk}</attribute>
                         <attribute name="managed">true</attribute>
                         <attribute name="langversion">linq</attribute>
                         <attribute name="supportspackagereferences">true</attribute>
@@ -2307,8 +2412,8 @@
                 </tasks>
             </framework>
             <framework
-                name="moonlight-2.0"
-                family="moonlight"
+                name="moonlight-2.0" 
+                family="moonlight" 
                 version="2.0"
                 description="Moonlight 2.0"
                 sdkdirectory="${toolDirectory}"
@@ -2329,13 +2434,17 @@
                     </modes>
                 </runtime>
                 <reference-assemblies basedir="${path::combine(prefix, 'lib/mono/2.1')}">
-                    <include name="agclr.dll" />
                     <include name="Microsoft.VisualBasic.dll" />
                     <include name="mscorlib.dll" />
                     <include name="System.Core.dll" />
                     <include name="System.dll" />
-                    <include name="System.Silverlight.dll" />
-                    <include name="System.Xml.Core.dll" />
+                    <include name="System.Net.dll" />
+                    <include name="System.Runtime.Serialization.dll" />
+                    <include name="System.ServiceModel.dll" />
+                    <include name="System.ServiceModel.Web.dll" />
+                    <include name="System.Windows.Browser.dll" />
+                    <include name="System.Windows.dll" />
+                    <include name="System.Xml.dll" />
                 </reference-assemblies>
                 <task-assemblies>
                     <!-- include MS.NET version-neutral assemblies -->
@@ -2351,8 +2460,11 @@
                 </task-assemblies>
                 <tool-paths>
                     <directory name="${toolDirectory}" />
+                    <directory name="${path::combine(prefix, 'lib/mono/4.5')}" />
                     <directory name="${path::combine(prefix, 'lib/mono/2.0')}" />
                     <directory name="${path::combine(prefix, 'lib/mono/1.0')}" />
+                    <!-- unmanaged tools -->
+                    <directory name="${prefix}/bin" />
                 </tool-paths>
                 <project>
                     <if test="${not pkg-config::exists('mono')}">
@@ -2360,10 +2472,19 @@
                     </if>
                     <property name="prefix" value="${pkg-config::get-variable('mono', 'prefix')}" />
                     <property name="toolDirectory" value="${path::combine(prefix, 'lib/mono/2.1')}" />
+                    <if test="${not(pkg-config::is-atleast-version('mono', '3.0'))}">
+                        <property name="csc.tool" value="smcs"/>
+                        <property name="mcs.sdk" value="0"/>
+                    </if>
+                    <if test="${pkg-config::is-atleast-version('mono', '3.0')}">
+                        <property name="csc.tool" value="mcs"/>
+                        <property name="mcs.sdk" value="2.1"/>
+                    </if>
                 </project>
                 <tasks>
                     <task name="csc">
-                        <attribute name="exename">smcs</attribute>
+                        <attribute name="exename">${csc.tool}</attribute>
+                        <attribute name="mcssdk">${mcs.sdk}</attribute>
                         <attribute name="managed">true</attribute>
                         <attribute name="supportspackagereferences">true</attribute>
                         <attribute name="supportsnowarnlist">true</attribute>