FAQ Database Discussion Community


How to preserve headers in the Flurl HttpClient

portable-class-library,dotnet-httpclient,flurl
I'm using the Furl.Http wrapper over the .NET Http Client. With each request my API requires a User-Agent and an Authorization header to be sent. I would like to set that up once, rather than having to state that every time. What I thought I would be able to do...

How to use NUnit 3 in VS2015RC

c#,nunit,portable-class-library,visual-studio-2015,nunit-3.0
Is it possible to use NUnit3 Beta in VS2015RC? I've just created a new Library Project (Package) and added NUnit and created a simple test to show the errors I'm getting. Does it have some dependency on an older version of the framework? project.json Test Class Update The Release Notes...

Getting inherited public static field with Reflection in Portable Class Libraries

c#,.net,reflection,portable-class-library
Within a Portable Class Library, I have 2 classes: The parent public class Parent { public string inherited; public static string inheritedStatic; } And the child the derives from it public class Child : Parent { public static string mine; } The problem is that I cannot get the inherited...

Nuget PCL library conflict

c#,.net,msbuild,nuget,portable-class-library
I'm using Nito.Async both in a PCL framework library and in client app which uses the library. The PCL lib targets .Net4.5 & SL5, and the client is .Net4.5. If I don't reference Nito.Async in client app, everything is fine. But if I reference it, when i run the app,...

C# Xamarin Android Rest call in PCL error “Unexpected character encountered while parsing value: S. Path '', line 0, position 0.”

c#,android,rest,xamarin,portable-class-library
I have used SO to help with several issues in the past. However, I cannot find a solution to something I have been struggling with for 2 days now. I am a noob, please be kind :) I have an app that I created using Xamarin Studio, targeted for Android....

The type or namespace Http does not exist in the the namespace Flurl

c#,.net,portable-class-library,flurl
Starting a new Portable Class Library project, I've added the Flurl.Http NuGet package, which appears to have also brought down all it's dependancies, as expected. However when I add the using Flurl.Http directive and some simple code such as using System.Threading.Tasks; using Flurl; using Flurl.Http; public class ClientRepository { public...

Its is better to create class lib or portable class lib?

c#,.net,asp.net-mvc,dll,portable-class-library
I have to use some API in my project and for that my boss asked me to create lib for that API. Its .Net project and may be in future it may have Android app. But for now he wants me to create lib in c# by hitting on API....

Portable Class Library vs. library project

c#,dll,monotouch,xamarin,portable-class-library
I want to now the difference between PCL and a normal library. PCL uses profiles with which it can be determined which plattforms and features are available. Both can generate a DLL which can be used on different plattforms. For a normal library project you can also set the target...

How to migrate a Windows Universal App to Portable Library Project?

c#,portable-class-library,windows-universal
I have previously developed a Windows Universal App. I would like to migrate all the non-platform specific code to place in a portable class library project for further development.How to achieve this? In the Windows Universal App there are some backend C# code controlling UI contents and manipulate the data...

How to get access to Microsoft.Phone.Control in a Portable Class Library

c#,.net,windows-phone-8,portable-class-library
I need to create a library for WP 8+ Apps that will recognize touches and gestures (and storing info about that). Is there a way to do this using Portable Class Library?

Can PCL libraries run with ASP.NET MVC?

c#,asp.net-mvc,wpf,portable-class-library
I wish to write a library that can run on a number of targets such as WPF, Windows Phone/Mobile, Mono, and ASP.NET. I keep searching for information on this but it seems PCL's are not supported in ASP.NET? Even VS indicates PCL can't be used with ASP.NET: So what should...

Check if a type defined by a Type variable implements an interface in .NET Portable

c#,.net,portable-class-library,win-universal-app
I have portable component in my universal app, and thus, the component uses .NET Portable v.4.6. In that component, I'm trying to check if the type defined by a Type variable myType implements a certain interface IMyinterface. If I were using the standard .NET framework, I could check if myType.GetInterface("MyClass.IMyinterface")...

Unable to load Rosyln generated PCL assembly in .NET (Full) 4.5 Console App

c#,.net,portable-class-library,roslyn
I am attempting to create a PCL assembly using Roslyn (Microsoft.CodeAnalysis). I'm referencing PCL assemblies located at "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile\Profile259". Here is my code that compiles the actual assembly. var assemblyName = string.Concat("ODataHQ.SDK.", accountKey, ".dll"); var source = GenerateAccountSource(accountKey, workspace); var assemblyInfoSource = GetAssemblyInfo(assemblyName); var assemblyTree = CSharpSyntaxTree.ParseText(assemblyInfoSource); var...

Equivalent of System.Xml.XmlAttribute in PCL land?

c#,portable-class-library,xmlserializer,xml-attribute
I'm attempting to convert some existing C# code into a Portable Class Library project, profile 111. Here is the code I'm stuck on: [System.Xml.Serialization.XmlAnyAttributeAttribute()] public System.Xml.XmlAttribute[] OtherAttributes { get { return this._otherAttributes; } set { this._otherAttributes = value; } } What is the equivalent of that in PCL land? I...

Add System-package to Xamarin PCL project

c#,xamarin,portable-class-library
I have multiple PCL projects and one iOS project in my solution. When I click References -> Edit References in the iOS project, i get a list of multiple packages that i could add, including e.g. System.Json. In the PCL projects, this list doesn't contain the System-packages. Is it possible...

Issue with android class library resources after updating xamarin

xamarin,monodroid,portable-class-library
After updating to the newest release from xamarin I am experiencing some issues regarding resources. We have a android class library which contains our core android app features, e.g activities, android resources(default Icons and so forth). This is referenced by multiple android projects each containing their own android resources for...

C# PCL HMACSHAX with BouncyCastle-PCL

c#,bouncycastle,portable-class-library
I want to implement this logic in portable C# class: static JsonWebToken() { HashAlgorithms = new Dictionary<JwtHashAlgorithm, Func<byte[], byte[], byte[]>> { { JwtHashAlgorithm.HS256, (key, value) => { using (var sha = new HMACSHA256(key)) { return sha.ComputeHash(value); } } }, { JwtHashAlgorithm.HS384, (key, value) => { using (var sha = new...