1iveowl / Simple-Http-Listener-PCL

Simple Http Server PCL for Xamarin Forms
MIT License
39 stars 6 forks source link

Nuget Package: PCL Net4.5 #3

Closed falahati closed 8 years ago

falahati commented 8 years ago

Hey man, Great job with this project and the parent fork (SocketLite.PCL). Used the code in past few weeks and it works great. Infact it was the most cross platform and stable framework I found on github and NUGET. But now I am trying to move pieces of my code to a PCL library with Profile259 (.NetPortable4.5) but I can't. The error message for all dependencies is same: (HTTPMachine, SocketLite.PCL, SimpleHttpLister)

You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', 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.

I can remember that by compiling from the source code I can actually use these libraries so I want to ask if possible, please fix the nuget packages so we can use in PCL projects. You see, my project is open source and compiling from source code is not a practical move. I strongly prefer using the Nuget packages.

Thanks a lot.

1iveowl commented 8 years ago

Hey Falahati,

Thanks for the feedback. Very much appreciated.

So, the reason why you can't use SimpleHttpListener v3+ in your PCL is that I've migrated it from a Profile 259 PCL to the future - i.e. .NET Standard 1.4.

Here is a great blog post on this topic: .NET Standard Library with Xamarin Forms

Now, you have at least two choices. You can either continue to use SimpleHttpListner v2, or you can migrate your own PCL to .NET Standard.

Could any of those two choices work for you?

falahati commented 8 years ago

Well unfortunately, one of my projects depends on this library (The one that I want to use your library in) and it is a Class Library project and as result cant reference a .NetStandard library. I am pretty stuck here in an other word xD I probably going to split my code to multiple platform libraries instead of one portable one for all and then use .NetStandard only when possible.

BTW, SimpleHttpListener 2.0 is compatible with profile 259, but not version of HttpMachine is installable on this profile. So I cant use it.

Thanks for the help

1iveowl commented 8 years ago

SimpleHttpListener v.2.0.4 depends on HttpMachine 1.1.1, both of which are (classic) PCL Profile259.

There are not that many improvements from these versions to the newer versions.

If you installed a newer library you might want to downgrade HttpMachine to V1.1.1 manually - i.e. the quickest way to do this is probably: update-package HttpMachine.PCL -Version 1.1.1 from the Nuget Console.

Let me know if this works for you?

falahati commented 8 years ago

Well I get this error:

SimpleHttpListener 2.0.4 is not compatible with .NETPortable,Version=v4.5,Profile=Profile259. HttpMachine.PCL 1.1.1 is not compatible with .NETPortable,Version=v4.5,Profile=Profile259. Some packages are not compatible with .NETPortable,Version=v4.5,Profile=Profile259.

PS: Also, I am not very familiar with .NetStandard, but why isn't it compatible with Windows ClassLibrary projects? From its definition, it should be compatible.

falahati commented 8 years ago

Also tried on a clean project and error message is still same:

Could not install package 'HttpMachine.PCL 1.1.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', 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.

1iveowl commented 8 years ago

Ahh, you are right. None of them have ever been compatible with PCL Profile259. Profile259 implies support for Silver Light, which have never been the case.

I don't recall the profile but I believe it was Profile7.

falahati commented 8 years ago

Yeah, I managed to get it working with Profile7, but this dropped the support for Windows Phone Silverlight 8.1 and Windows Phone 8.1

I hate Silverlight, so that part is alright, but Windows Phone 8.1 was a loss.

Thanks a lot.

1iveowl commented 8 years ago

I tested it too and got it to work with Profile7 and yes Profile 7 does not include Windows Phone 8.1.

In fact I've only ever tested the library with UWP and .NET 4.5.1+.