在OSX/Linux上的MonoDevelop中还原NuGet软件包 [英] NuGet Package Restore in MonoDevelop on OSX/Linux

查看:158
本文介绍了在OSX/Linux上的MonoDevelop中还原NuGet软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在MonoDevelop下使用NuGet包还原来编译Visual Studio项目,但无法立即使用.

I'm trying to compile a Visual Studio project with NuGet package restore under MonoDevelop but it's not working out of the box.

NuGet应该可以在Mono上运行,并且甚至在nuget.targets中内置了支持,所以缺少了什么?

NuGet should work on Mono and there's even support built into nuget.targets, so what is missing?

推荐答案

基于此处跟踪的问题: https: //nuget.codeplex.com/workitem/3278

Based on issue tracked here: https://nuget.codeplex.com/workitem/3278

  1. 您必须对所有应在构建时还原软件包的项目使用xbuild. MonoDevelop->首选项->构建
  2. Unix文件系统区分大小写.这会破坏nuget.targets,因为假定文件内的大小写都是小写,而添加到.nuget文件夹中的解决方案中的文件的大小写类似于"NuGet".修正nuget.targets或将解决方案.nuget文件夹中的文件名更改为小写.
  3. RequireRestoreConsent在nuget.targets中默认为true.编辑nuget.targets并将其更改为false.
  4. 程序包还原将程序包文件夹放置在奇怪的位置,即$(SolutionDir)/ /packages(是的,两者之间只有一个空白文件夹).原因是<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -solutionDir "$(SolutionDir) "</RestoreCommand>
  5. $(SolutionDir)之后的nuget.targets中存在尾随空格
  1. You must use xbuild with all projects that should restore packages on build. MonoDevelop->Preferences->Build
  2. Unix filesystems are case-sensitive. This breaks nuget.targets as the casing inside the file is assumed to be all lower case whereas the files added to a solution in the .nuget folder are cased like "NuGet". Either fixup nuget.targets or change the filenames in your solutions .nuget folder to all lower case.
  3. RequireRestoreConsent is true by default in nuget.targets. Edit nuget.targets and change it to false.
  4. Package restore puts the package folder in a weird location, $(SolutionDir)/ /packages (yes, theres a single whitespace folder in between). The reason is that there's a trailing whitespace in nuget.targets in after $(SolutionDir) in <RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -solutionDir "$(SolutionDir) "</RestoreCommand>

这篇关于在OSX/Linux上的MonoDevelop中还原NuGet软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆