2
votes

So I've been working on a game, and the sheer number of projects has become unmanageable. Enter NuGet.

I wanted to ensure my code would work on different devices, so I've been making these projects as Portable Class Libraries. I needed to use these on XBox, Windows, iOS, Android, and Silverlight. I created some custom custom SupportedFrameworks in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.0\Profile\Profile1\SupportedFrameworks Specifically MonoAndroid and VSMonoTouch

I successfully turned one of these PCLs into a NuGet package, but when I try to add them to another PCL of the same profile I get this error: Could not install package 'Framework.dll 1.0.0.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.0,Profile=Profile1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

The package folder was brought down and contains a folder named: portable-win+net40+MonoAndroid16+sl40+net10+wp+Xbox40 and indeed contains the requested dll. I am able to add this dll to my project manually, so I believe this may be a bug in NuGet. I investigated this online, and found the main fix was to update NuGet, because the newest version plays nicer with PCLs. I've updated, but to no avail.

Has anyone seen this before, or am I missing something obvious? Any help would be greatly appriated =)

Thanks, Joshua

1
monoandroid was added with nuget.codeplex.com/workitem/2847 in the upcoming 2.5 release. if you want to try a nightly pre-release build with the fix it can be downloaded from build.nuget.org/NuGet.Tools.vsixDeepak
I faced same problem. Checkin target version explicitly solved it.Davut Gürbüz

1 Answers

0
votes

It looks like you are using ".NETFramework" for the identifier in the XML file you put in the Profile1 SupportedFrameworks folder. This was basically a hack to get iOS projects building on Windows, but with real support for that scenario you should change that identifier to MonoTouch. Then when you create the package it should use monotouch in place of net10 for the lib/portable-x+y+z folder.

Then, as @Deepak suggests, install the nightly build of NuGet. Then you should be able to install the NuGet package into your PCL project. If you do try this, please let me know whether it worked or not. :)