Does RestSharp not support Windows Phone 8? - windows-phone-8

I've always used RestSharp to handle async requests on Windows Phone 7 & 7.8 applications, but today, I was trying to add RestSharp to a Windows Phone 8 application and it wouldn't work. This is the error received:
Install-Package: Unable to install the package "RestSharp 104.1". You are attempting to install this package to a will "WindowsPhone, Version = v8.0" as the target of the project, but this package does not contain any compatible with the framework assembly references

I got HTTP requests working by using a Portable HttpClient for .NET Framework and Windows Phone
The last version of it was published on 2/18/2013 and it can be included in the project using the NuGet package manager.
You can find details at the following link:
http://blogs.msdn.com/b/bclteam/archive/2013/02/18/portable-httpclient-for-net-framework-and-windows-phone.aspx
Having installed it
using System.Net.Http;
is now recognized.

Related

Chat application using socket.io in windows phone 8.1

"Could not install package 'SocketIO4Net.Client 0.6.26'. You are trying to install this package into a project that targets
'WindowsPhoneApp,Version=v8.1".Getting this error while installing the library..Please help me to find an appropriate library..
This message means that you try to install a library that is not compatible with Windows Phone 8.1.
Lookat that nuget package shows only a .net 4.0 library:
socketio4net.client.0.6.26\lib\net40
which can be only used in Desktop .Net 4.x (40, 4.5.x, 4.6.x) projects.
You need to use a WinRT compatible lib that supports Phone 8.1.

Parse.com for Windows Phone 8 - get_LocalSettings() not implemented

I am using Parse.com storage service for Windows Phone 8. When I try to initialize
ParseClient.Initialize("MY_APP_ID","MY_NET_ID");
I am getting this exception:
System.NotImplementedException: The method or operation is not implemented.
at Windows.Storage.ApplicationData.get_LocalSettings()
at Parse.PlatformHooks.SettingsWrapper..ctor()
at Parse.PlatformHooks.SettingsWrapper.get_Wrapper()
at Parse....
I am targeting Windows Phone 8 and I found out that WP8 is not supporting LocalSettings, just WP8.1.
When I target it to WP8.1 everything is working fine.
But...
I have another application for WP8 in which I am using Parse and everything is working fine.
How can I avoid this problem?
Just for info: App which does not work was built for WP7.1 and than upgraded to WP8, and another which works fine was from beginnig targeting WP8.
Thanks
I found the solution. If someone has the same problem, just install older version of parse package in Nuget.
PM> unInstall-Package parse
PM> Install-Package parse -Version 1.2.16

Cant use NuGet to add Unity IoC to a portable class library

I am making a Windows Phone 8 application, however because I would like at some point to also publish this application for Windows 8.1 store I made the effort to factor out the application logic into a portable class library. All good so far.
Now being a good boy I want to use an IoC container, unity by preference (since I am familiar with it in desktop and Win Phone 8 only apps)
So here's my problem; the NuGet Unity package will not install into my portable application with this result:
Installing 'Unity 3.0.1304.1'.
Successfully installed 'Unity 3.0.1304.1'.
Adding 'Unity 3.0.1304.1' to Logic.
Uninstalling 'Unity 3.0.1304.1'.
Successfully uninstalled 'Unity 3.0.1304.1'.
Install failed. Rolling back...
Could not install package 'Unity 3.0.1304.1'. You are trying to install this package into a
project that targets 'portable-net45+wp80+win', 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.
So is there a unity that works with a PCL? or is this just a shortcoming of the NuGet package?
I failed to find any useful documentation on the P&P website to indicate what platforms it is compatible with, but I know it does support WP8 at the least since the NuGet package is quite happy with libraries targeting just that.
Any guidance from the community would be very welcome here I don't want to abandon using a PCL for my app logic if I can avoid it, but if it comes down to a toss up between that and NuGet for package management I will in order to keep the NuGet goodness.
Could this be related to NuGet and Portable Class Libraries - Package doesn't target any framework? that seems more related to making your own NuGet packages for use in your own PCLs.
Unity 3.0.1304.1 does not contain any PCL assemblies so you will not be able to install it into a PCL project using NuGet.
The Unity NuGet package contains assemblies that target the following frameworks:
.NETFramework 4.5
.NETCore 4.5 (Windows Store/WinRT)
Windows Phone 8
You can see these target frameworks if you open the NuGet package into NuGet Package Explorer or download the NuGet package and open it using a program that supports zip files such as 7zip or Windows built-in zip file support.
So your possible options are:
Just use Unity in your main Windows Phone 8 application.
Write your own IOC container.
Use an IOC container that supports PCL projects such as Portable.CommonServiceLocator.
Compile your own PCL version of Unity.
Use a later version of Unity 3.5 since this includes a PCL assembly targeting portable-net45+wp80+win8+MonoAndroid10+MonoTouch10
Updated: 2014-05-11
Unity 3.5 now includes a PCL assembly that targets portable-net45+wp80+win8+MonoAndroid10+MonoTouch10 which will install into a project that targets portable-net45+wp80+win.
There is no Unity for PCL, but you can use Ninject for example.

Windows phone 8 image uploading to windows azure

I want to upload Image from my windows phone 8 application to azure , I have searched a
lot and found various solutions in windows phone 7 all are using
"Phone.Storage"
, but when I try to install it for my windows phone 8 app , it throw error.
I have also tried vaious packages using nuget package manager but every one installation faild at
'Microsoft.WindowsAzure.ConfigurationManager 1.7.0.3'. Install
failed. Rolling back...
Please help me resolve this issue, and if there exist a good tutorial , please share .
Zauk
I had similar problem, the reason was that the NuGet version that ships with VS2012 RTM doesn't support WP8. Can you try to update your NuGet package manager to the latest version.
Go to
Menu Tools -> Extensions and Updates -> Updates -> Visual Studio Gallery -> NuGet
update restart.
If you are getting this error when trying to install the Azure Storage library from Nuget. "Could not install package 'Microsoft.WindowsAzure.ConfigurationManager'" . That is because the package you are trying to install does not include the Windows Phone 8 library.
As a fix: Use this command from the package manager console:
Install-Package WindowsAzure.Storage-Preview -Pre
Here is some documentation on how to implement it, after you are done installing the Azure Storage SDK
http://www.windowsazure.com/en-us/documentation/articles/mobile-services-windows-phone-upload-data-blob-storage/

Does protobuf-net support Windows RT?

Is it possible to use the protobuf-net library in an application that targets Windows RT? I tried adding it via NuGet to my project but I receive this error:
Successfully installed 'protobuf-net 2.0.0.480'.
Successfully uninstalled 'protobuf-net 2.0.0.480'.
Install failed. Rolling back...
Could not install package 'protobuf-net 2.0.0.480'. You are trying to install this package into a project that targets '.NETCore,Version=v4.5', but the package does not contain any assembly references that are compatible with that framework. For more information, contact the package author.
You need a newer version. Version 594 has support for 4.5.
In the package manager console (Tools->Library Package Manager->Package Manager Console) run:
PM> Install-Package protobuf-net -Version 2.0.0.594
Or download it from the project web site.
Yes, the more recent builds have full support for .NETCore (aka "WinRT", "Windows Store Applications", or "Metro", or "Modern UI", or whatever they want to call it today). As Eli notes, you can obtain it by specific version, or you can get it from the google-code download.
Note that for the best performance it is recommended to use "precompile", the new precompiler, because .NETCore has no support for meta-programming: without this, it will be using reflection at runtime, and will not be anywhere near as fast as it can be. This is included in the google-code download.