How do I resolve configuration errors with Nant 0.91?

霸气de小男生 提交于 2019-11-29 20:54:46

Oddly enough, this is related to how the executables are extracted from the Nant 0.91 archive. (This made no sense to me until I actually tried it, but it does actually work...)

Source : http://surfjungle.blogspot.com/2011/11/tip-running-nant-091-on-windows-7.html

I found that the problem was Windows 7 security related in that the downloaded NAnt 0.91 zip file needed additional security related configuration to be performed: before extracting, one must right click on the zip file, select Properties and under the General tab, click the button labelled Unblock, then click OK on the Properties window. Now, extract the file to your desired location, ensure it is on the system path, open a new command line and NAnt should run successfully.

Mike

I had this same problem, however my Properties/General tab did not contain an unblock button. (I'm not sure why; it seems as though this is potentially related to the fact that I'm running inside VMWare Fusion virtual machine.)

This problem seemed to go away if I used something besides Windows built-in ZIP extractor to extract the file. For example, I used 7-Zip to extract the archive and everything worked fine.

Here's how to unblock all the files recursively after the fact with powershell. Weirdly, unblock-file only checks for the pspath property over the pipe.

get-childitem -recurse c:\nant-92 | 
get-item -stream zone.identifier -erroraction silentlycontinue | 
foreach { $_.pspath = $_.pspath -replace ':zone.identifier'; $_ } | 
unblock-file

Of course you could do it this way, without knowing which was blocked or not:

get-childitem -recurse c:\nant-92 | unblock-file
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!