I couldn't find this exact question on SO, the only solution involves Unblocking a file. In my scenario, the entire nant directory is unblocked (using PS), but I still get the following exception:
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'System.String System.String.Format(System.IFormatProvider, System.String, System.Object, System.Object'.
at NAnt.Core.ConsoleDriver.Main(String[] args)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at NAnt.Console.ConsoleStub.HelperArguments.CallConsoleRunner()
at NAnt.Console.ConsoleStub.Main(String[] args)
A couple of things to mention:
1) I compiled this .exe on my local machine from the HEAD revision of the GitHub project (https://github.com/nant/nant) and encountered the same "Unblock" issue described in Nant failing with bad permissions on build server, for which I used the streams.exe answer for unblocking the entire nant directory on my local machine.
2) I have the .NET 4.5 runtime installed on the Win2k12 instance. When I built the exe on my local machine (as stated in point 1), I used the suggested nmake command from the GitHub readme:
nmake -f Makefile.nmake install prefix="c:\Program Files" TARGET=net-4.0
Specifically, I left the TARGET argument as "net-4.0". I'm not sure if this matters, since I'm running a newer version on the Wink2k12 server.
Any help is greatly appreciated!!