I have a Xamarin 2 solution that's been working fine - but it suddenly won't build using Xamarin Studio for Mac. (It builds fine using Visual Studio)

This is the build error:

/Source/trunk/c1/.nuget/NuGet.targets: Error: Command 'mono --runtime=v4.0.30319 Source/trunk/c1/.nuget/NuGet.exe install "" -source "" -RequireConsent -solutionDir "/Source/trunk/c1/"' exited with code: 1. (c1.Models)

I'm using this Add-in to restore Nuget packages within Xamarin Studio for Mac. All of the Nuget packages are downloaded and restored. https://github.com/mrward/monodevelop-nuget-addin

This article mentions a similar problem, but I've removed the space as it suggests and it hasn't made a difference. http://nuget.codeplex.com/workitem/3332

I would greatly appreciate any tips - thank you!

有帮助吗?

解决方案

You hit just one of the typical NuGet/xbuild compatibility issues, including the one I reported a while ago,

http://nuget.codeplex.com/workitem/list/basic?field=CreationDate&direction=Descending&issuesToDisplay=All&keywords=xbuild&emailSubscribedItemsOnly=false

http://nuget.codeplex.com/workitem/4051

The workaround you find like using the latest NuGet.targets can help, but ultimately Microsoft guys have implemented a brand new restore approach (which has been deployed already to all Microsoft platforms), now it is time to wait for Xamarin to catch up.

(Updated: Now you should use mono --runtime=v4.0.30319 .nuget/NuGet.exe update /self mono --runtime=v4.0.30319 .nuget/NuGet.exe restore my.sln to restore packages.

More information can be found at NuGet site)

其他提示

I think I've solved this problem. I replaced the NuGet.targets file with the following:

https://raw.github.com/xamarin/Xamarin.Mobile/master/.nuget/NuGet.targets

That file seems like a more modern file that fixes some of the -RequireConsent and $(SolutionDir) spacing issues. I lost many hours on this - hope it helps someone else.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top