且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Nant在构建服务器上由于权限错误而失败

更新时间:2023-02-15 16:46:16

@TK在这里有答案,尽管它可能不像nant是否从网络驱动器运行那么简单.

@TK has the answer here, I believe, though it may not be as simple as whether or not nant is running from a network drive.

我遇到了与@Aidan类似的问题.事实证明,我已经将nantcontrib(v.86)程序集复制到了我的构建系统中,使得Windows 7限制了对nantcontrib程序集的访问.要解决此问题,我首先将nantcontrib zip文件复制到了我的构建VM,然后用.zip的内容覆盖了被阻止的程序集. Windows 7看到文件来自本地系统(而不是我最初复制的任何不受信任的来源),并且取消了对程序集的阻止.

I have had a similar issue as @Aidan. It turns out that I had copied the nantcontrib (v .86) assemblies to my build system in such a way that Windows 7 restricted access to the nantcontrib assemblies. To fix this, I first copied the nantcontrib zip file to my build VM, then overwrote the blocked assemblies with the contents of the .zip. Windows 7 saw that the files were coming from the local system (rather than from whatever untrusted source I had copied from originally) and it unblocked the assemblies.

也许有更直接的方法来信任程序集(例如@TK的链接),但这对我有用.

There is probably a more direct means of trusting the assemblies (such as @TK's link), but this worked for me.

如果再次出现此错误,请寻找两件事:

If you see this error again, look for two things:

首先,南特(v.91 alpha 2)做得体面,准确地报告了错误所在.我看到了与@Adian相同的错误,以及一个完整的错误堆栈,最后看到了此信息(强调我的意思):

First, Nant (v .91 alpha 2) does a decent job reporting exactly what the error is. I saw the same error as @Adian, along with a complete error stack, and finally this information (emphasis mine):

失败的程序集或AppDomain是:NAnt.Contrib.Tasks, 版本= 0.86.3319.0,文化=中性,PublicKeyToken =空方法 导致失败的是:NAnt.Core.Task CreateChildTask(System.Xml.XmlNode)
该程序集所在的区域 失败的是:Internet
失败的程序集的网址是: 文件:///C:/Program Files(x86)/NAntBuilder 2/nantcontrib/bin/NAnt.Contrib.Tasks.dll

The assembly or AppDomain that failed was: NAnt.Contrib.Tasks, Version=0.86.3319.0, Culture=neutral, PublicKeyToken=null The method that caused the failure was: NAnt.Core.Task CreateChildTask(System.Xml.XmlNode)
The Zone of the assembly that failed was: Internet
The Url of the assembly that failed was: file:///C:/Program Files (x86)/NAntBuilder 2/nantcontrib/bin/NAnt.Contrib.Tasks.dll

第二,查看有问题的程序集的属性页(在我的情况下为Nant.Contrib.Tasks.dll).如果文件是从不受信任的来源复制的,您将在属性部分(位于高级..."下)看到取消阻止"按钮,以及一条说明文件来自不受信任的来源的注释.

Second, look at the property page of the offending assembly (in my case, Nant.Contrib.Tasks.dll). If the file has been copied from an untrusted source, you will see an "Unblock" button in the properties section (beneath Advanced...) along with a note which stated that the files had come from an untrusted source.