code_junkie

How do I get NAnt to use the new VB9 compiler for .NET 2.0 applications?

Nov 13th, 2011
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. Public Class SomeObject
  2. Public Name As String
  3. End Class
  4. Private SomeList As List(Of SomeObject) = SomeObject.GetAllSomeObjects()
  5. Public Function FindFirstItemWithSimilarName(ByVal x As String) As SomeObject
  6. Return SomeList.Find(Function(p As SomeObject) p.Name.Contains(x))
  7. End Function
  8.  
  9. <property name="nant.settings.currentframework" value="net-2.0"/>
  10.  
  11. using System;
  12. using System.Collections.Generic;
  13. using System.Diagnostics;
  14. using System.Text;
  15.  
  16. namespace MSBuild
  17. {
  18. public class Program
  19. {
  20. public static int Main(string[] args)
  21. {
  22. for (int argIndex = 0; argIndex < args.Length; argIndex++)
  23. {
  24. if (args[argIndex].Contains(" "))
  25. {
  26. string quotedArg = string.Format(""{0}"", args[argIndex]);
  27. args[argIndex] = quotedArg;
  28. }
  29. }
  30.  
  31. string arguments = string.Join(" ", args);
  32.  
  33. // HACK: I should probably change
  34. // this to automaticlaly
  35. // determine the path
  36.  
  37. Process process = Process.Start("C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe",arguments);
  38.  
  39. process.WaitForExit();
  40.  
  41. return process.ExitCode;
  42.  
  43. }
  44. }
  45. }
  46.  
  47. <property name="nant.settings.currentframework" value="net-3.5"/>
Add Comment
Please, Sign In to add comment