2014-11-03 88 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