2012-04-17 90 views
1

是否可以將PostSharp與NuGet軟件包恢復一起部署到源代碼庫中? 我可以通過提交postsharp軟件包來實現這個工作,但是這會抵消Package Restore功能的價值。使用NuGet軟件包恢復PostSharp到源代碼庫

這就是我所做的。

我看到這在我的csproj

<Import Project="..\packages\PostSharp.2.1.6.13\tools\PostSharp.targets" /> 
<Import Project="$(SolutionDir)\.nuget\nuget.targets" /> 

(我重新命令th EM無濟於事)

我的構建服務器(CC.net)報告以下錯誤:

D:\wwwroot\www.snip.co.nz\http\www.snip.co.nz.csproj (714,3): 

errorMSB4019: The imported project  "D:\wwwroot\www.snip.co.nz\packages\PostSharp.2.1.6.13\tools\PostSharp.targets" was not found. Confirm that the path in the &lt;Import&gt; declaration is correct, and that the file exists on disk. 

CacheAttribute.cs (8,7): 
errorCS0246: The type or namespace name 'PostSharp' could not be found (are you missing a using directive or an assembly reference?) 
…etc… 

回答

1

您目前(v2.1.6.13)已修復的csproj支持包還原, 在導入目標元素中添加此處顯示的條件:

<Import Project="..\packages\PostSharp.2.1.6.13\tools\PostSharp.targets" 
    Condition="Exists('..\packages\PostSharp.2.1.6.13\tools\PostSharp.targets')" />