Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the package does not contain any assembly references or content files that are compatible with that framework #1325

Closed
maartenba opened this issue Sep 3, 2015 · 12 comments
Labels
Resolution:ByDesign This issue appears to be ByDesign

Comments

@maartenba
Copy link
Contributor

From @NVentimiglia on September 2, 2015 22:35

I am trying to install a nuget package and failing. Both the nuget package and the importing project are of the same type (PCL target 259). When I try to import the project, I get this error.

Could not install package 'WebSocket.Portable.Core 1.2.2'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.0,Profile=Profile24', 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.

After emailing myself the issue, I tried to republishing the nuget package using the manager tool (vs 1.2.3) and that did not work. Here is my nuget package explorer.

nugetmad

Using VS 2015 and NuGet 3.1.6

Copied from original issue: NuGet/NuGetGallery#2654

@ericstj
Copy link

ericstj commented Sep 3, 2015

Yep, this package won't apply. Profile24 is equivalent to net45+sl5, but the package doesn't support SL5 at all. It'd be nice if nuget didn't just throw up profile numbers in the error messages, that'd make this a bit easier to understand. Perhaps something like "You are trying to install this package into a project that targets a portable profile supporting .NET Framework 4.5 and Silverlight 5 but the package doesn't contain any..."

@NVentimiglia
Copy link

@ericstj So the solution would be to add a Silverlight5 lib target to my package ?

@NVentimiglia
Copy link

I added Silverlight5 target. This did not help.

Could not install package 'WebSocket.Portable.Core 1.2.4'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.0,Profile=Profile24', 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.

@yishaigalatzer
Copy link

Is the package available anywhere, along with the project you are trying to install it into?

@NVentimiglia
Copy link

@yishaigalatzer The githup / nuget package is available at

https://github.com/NVentimiglia/WebSocket.Portable

I am importing this package into a new PCL library (fresh from visual studio).

@yishaigalatzer
Copy link

Thanks for getting back. What exact flavor of pcl?

@NVentimiglia
Copy link

A new one. I tried a number of combinations including one that targeted the same platforms as the websocket library and another that targeted a smaller subset. Xamarin iOS, Xamarin Droid, and .net 4.5 were my minimal.

@yishaigalatzer
Copy link

Would you mind sharing your project, to make sure we are verifying the exact same thing you are using.

@yishaigalatzer
Copy link

@ericstj do you have any more suggetions on this?

@NVentimiglia please update to NuGet 3.2 for the continuation of this discussion

@ericstj
Copy link

ericstj commented Sep 23, 2015

Sorry for the delay, have been out of town.

@ericstj So the solution would be to add a Silverlight5 lib target to my package ?
No you need to expand the portable profile folder to include SL5.

Consider that PCL requires a dll to compile against. It needs one that supports all the targets.

So the project you are installing into is targeting .NETPortable,Version=v4.0,Profile=Profile24. Nuget translates this to portable-net45+sl5. If you check the PCL targeting dialog in the project properties of the project you'd see something similar.
pcl-net45 sl5

Now consider if any of the folders support both net45 and sl5.
MonoAndroid -> nope
MonoTouch -> nope
portable-net45+wp8+win8 -> nope, doesn't support SL5
sl5 -> nope doesn't support net45

From the latest in GitHub
portable-net45+win+wpa81+wp80+Xamarin.iOS10+MonoAndroid10+MonoTouch10 -> nope, doesn't support SL5.

So, if you wanted to use this package in a PCL that includes SL5 support you need to build the PCL (either a single DLL, or a separate DLL) to a PCL profile that includes SL5.
So you'd change this project from targeting net45+win8+wpa81+wp8 to include SL5 as well. That'd be Profile344 I believe. This all assumes you can actually do that and still have the surface area you need to implement WebSocket.Portable.

After doing this you'd have a folder in your package like the following:
portable-net45+win+wpa81+wp80+SL5+Xamarin.iOS10+MonoAndroid10+MonoTouch10 -> YES supports both net45 and SL5.

@NVentimiglia
Copy link

@ericstj That worked. I manually adjusted my nupkg file with a target for portable-net45+win+wpa81+wp80+SL5+Xamarin.iOS10+MonoAndroid10+MonoTouch10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution:ByDesign This issue appears to be ByDesign
Projects
None yet
Development

No branches or pull requests

5 participants