2014-11-03 87 views
0

我正在尝试使用FAKE Nuget帮助程序生成nuspec并将其打包。问题是,当它生成一个nuspec时,它被设置为ReadOnly。从那里,当nuget.exe运行时,它会在尝试执行打包过程时引发“访问被拒绝”。FAKE Nuget包装创建文件为只读

我需要做些什么来规避这个问题?

enter image description here

回答

0

好吧,这是不是最好的解决办法,但这里是我做了什么。

在启动FAKE脚本的Powershell脚本中,我添加了一个步骤来更改nuspec属性,删除ReadOnly标志。

这似乎是在做我所需要的。

$rootDir = (Resolve-Path $pwd\) 
$nuspecFile = (Join-Path $rootDir \nuspec\GeoSphere.nuspec) 

Write-Host "Attempting to change the readonly status of $nuspecFile" 
Set-ItemProperty $nuspecFile -name IsReadOnly -value $false