首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NAnt停止在Windows Server 2012上运行,抛出未处理的异常: System.Reflection.TargetInvocationException

NAnt停止在Windows Server 2012上运行,抛出未处理的异常: System.Reflection.TargetInvocationException
EN

Stack Overflow用户
提问于 2015-08-12 00:38:13
回答 1查看 282关注 0票数 0

我在SO上找不到这个确切的问题,唯一的解决方案是解锁一个文件。在我的场景中,整个nant目录是解锁的(使用PS),但我仍然得到以下异常:

代码语言:javascript
复制
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)在我的本地机器上编译了这个.exe,并遇到了Nant failing with bad permissions on build server中描述的相同的“解锁”问题,对于这个问题,我使用streams.exe答案来解锁我本地机器上的整个nant目录。

2)我在Win2k12实例上安装了.NET 4.5运行时。当我在本地机器上构建可执行文件时(如第1点所述),我使用了GitHub自述文件中建议的nmake命令:

nmake -f Makefile.nmake install prefix="c:\Program Files" TARGET=net-4.0

具体地说,我将目标参数保留为"net-4.0“。我不确定这是否重要,因为我在Wink2k12服务器上运行较新的版本。

非常感谢您的帮助!

EN

回答 1

Stack Overflow用户

发布于 2015-08-12 01:05:52

好吧,所以我修复了我的问题,不是从源代码构建,而是从sourceforge (http://nant.sourceforge.net/)下载最新发布的压缩包,并执行以下操作:

1)从sourceforge下载"nant-0.92-bin.zip“发行版

2)将zip复制到服务器

3)右击zip,点击底部'General‘选项卡下的"Unblock“按钮(如果没有,说明它没有被阻止)

4)压缩包解压内容

完成这些步骤之后,nant.exe程序就可以正常运行了。我不确定这个问题是否可以被认为是重复的问题,因为另一个问题似乎更倾向于nunit2report contrib工具。希望这对其他人有帮助!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31947359

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档