【发布时间】:2015-08-11 16:38:12
【问题描述】:
我在 SO 上找不到这个确切的问题,唯一的解决方案是取消阻止文件。在我的场景中,整个 nant 目录被解锁(使用 PS),但我仍然得到以下异常:
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)
有几点要提:
1) 我在本地机器上从 GitHub 项目 (https://github.com/nant/nant) 的 HEAD 修订版编译了这个 .exe,并遇到了Nant failing with bad permissions on build server 中描述的相同“取消阻止”问题,为此我使用了 streams.exe 答案用于解锁我本地机器上的整个 nant 目录。
2) 我在 Win2k12 实例上安装了 .NET 4.5 运行时。当我在本地机器上构建 exe 时(如第 1 点所述),我使用了 GitHub 自述文件中建议的 nmake 命令:
nmake -f Makefile.nmake install prefix="c:\Program Files" TARGET=net-4.0
具体来说,我将 TARGET 参数保留为“net-4.0”。我不确定这是否重要,因为我在 Wink2k12 服务器上运行更新版本。
非常感谢任何帮助!
【问题讨论】: