portable-class-library

Are there any REST libraries out there that work with Portable Class Libraries? [closed]

给你一囗甜甜゛ 提交于 2019-11-30 08:44:07
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I am developing a portable class library that needs to make REST requests and am looking for something like Restsharp or EasyHttp. Unfortunately neither of these currently work with PCLs. It would also be nice to either see an example that does a post request with basic authentication. If there is nothing out

How do I work with images in a portable class library targeting Windows Store Apps and WP7,WP8,WPF?

强颜欢笑 提交于 2019-11-30 08:16:24
I am working on a first PCL that targets : WSA (Windows Store Application), WPF,WP7,WP8. We can say that it is a rolerdex kind of application, you have contacts , they have contact details and images. (it's not, but I can't give details about the application, so I am using a very simple example instead). Here are some of my questions :) Should I have the images in the PCL? If yes: How do reference the image for usage in WSA? How do I best solve scaling with the scale qualifiers etc. when used across different projects? I am not using a database and the images are not downloaded from an

Method not found: 'Void Newtonsoft.Json.Serialization.DefaultContractResolver.set_IgnoreSerializableAttribute(Boolean)' (webapi and PCL)

落花浮王杯 提交于 2019-11-30 06:55:28
Similar to this question , which was marked as a duplicate (so I couldn't answer it directly). I have a webapi project, which references a PCL project. I was getting this DefaultContractResolver error intermittently. I had tried all of the troubleshooting steps from that other question, largely involving uninstalling and reinstalling the nuget packages. Didn't help. The root cause of the problem for me was that both my webapi project and my PCL project were referencing Newtonsoft.Json.dll. There seemed to be some kind of race condition in Visual Studio build, so that if the PCL project was

Modify request headers per request C# HttpClient PCL

青春壹個敷衍的年華 提交于 2019-11-30 04:18:41
I'm currently using the System.Net.Http.HttpClient for cross platform support. I read that it is not a good practice to instantiate a HttpClient object for each request and that you should reuse it whenever possible. Now I have a problem while writing a client library for a service. Some API calls need to have a specific header, some MUST not include this specific header. It seems that I can only manipulate the "DefaultRequestHeaders" which will be send with each request. Is there an option when actually making the request with e.g. "client.PostAsync()" to modify the headers only for the

Portable class library for MonoDroid and MonoTouch

点点圈 提交于 2019-11-30 04:05:17
I want to create PCL for MonoDroid and MonoTouch, to share code AES encryption (RijndaelManaged), but Visual Studio wouldn't let me to do so, instead it forces me to add all other frameworks, message is following: The following frameworks will be selected automatically because they support all of the available functionality that is portable between the other frameworks you have selected: .NET for Windows Store apps, .NET Framework 4.5, Windows Phone 8. and those frameworks doesn't support System.Security.Cryptography namespace. Files for MonoDroid and MonoTouch are placed in C:\Program Files

Convert async lambda expression to delegate type System.Func<T>?

偶尔善良 提交于 2019-11-30 03:02:28
I have an async method inside a portable class library with this signature: private async Task<T> _Fetch<T>(Uri uri) It fetches a resource that is cast back as a concrete type T. I'm working with a 3rd party cache library ( Akavache ) that requires a Func<T> as one of the parameters and have tried to do so in this manner: await this.CacheProvider.GetOrCreateObject<T>(key, async () => await _Fetch<T>(uri), cacheExpiry); This results in the error: Cannot convert async lambda expression to delegate type ' System.Func<T> '. An async lambda expression may return void , Task or Task<T> , none of

Windows Phone development and Unit Testing

十年热恋 提交于 2019-11-30 01:01:08
I'm looking to start a project targeting Windows Phone, but I'm slightly put off by the lack of unit testing support[1]. I'm used to using NUnit/ XUnit for most of my testing needs, with something like NSubstitute for mocking. Near as I can tell, you can't use these frameworks for Windows Phone projects... Given some investigation, I was wondering if the following scenario would work: Use Visual Studio 2012 Create a Portable Class Library project(s) for the View Models and other logic Create other Portable Class Library project(s) for the unit tests Wait for Windows Phone 8 SDK[2], then create

using SQLite inside portable class library

我与影子孤独终老i 提交于 2019-11-29 21:53:43
recently we started to work on a new project which includes clients for Windows 8 Metro, Windows Phone and Desktop application. it was decided to use MVVM pattern as main Architecture because sharing ViewModels between projects is much more acceptable solution for us. we decided to use portable class library for this purpose, but the problem is that after downloading and installing SQLite for windows runtime from Visualstudio 2012 extension gallery when we try to add reference to appropriate libraries we do not see those libraries at all. this makes us think, that it is not possible to use

Portable Class Library in MVC 4 / Razor with Visual Studio 2012 RC?

故事扮演 提交于 2019-11-29 20:09:23
since working with Visual Studio 2012 RC we get an HttpCompileException when using a class out of an portable class library (.net 4.5 & metro profile) within a razor view. Exception: (german to english translated on google, sorry) System.Web.HttpCompileException (0x80004005): c:\Users\user\AppData\Local\Temp\Temporary ASP.NET Files\root\1995167a\126b7c4d\App_Web_index.cshtml.1fbcdbb1.zaniprm5.0.cs(29): error CS0012: The type 'System.Object' is not in a referenced assembly is defined. Add a reference to the Assembly "System.Runtime, Version = 4.0.0.0, Culture = neutral, PublicKeyToken =

How should i use Azure Mobile Services with PCL or without it now?

点点圈 提交于 2019-11-29 17:58:47
问题 I updated to latest version of Xamarin, where PCL is "fully supported". How can i use Azure Mobile Services now? if i create PCL lib and trying to add it with NuGet it failed to install "Newtonsoft.Json 5.0.8" because it needs "portable-net45+wp80+MonoAndroid10+MonoTouch10" which is missing. if i create simple android lib and add Azure from components it's generate excepton: System.InvalidOperationException: A Windows Azure Mobile Services assembly for the current platform was not found.