Questions tagged [portable-class-library]

The Portable Class Library project enables you to write and build managed assemblies that work on more than one .NET Framework platform (Silverlight, WP7, or XNA).

portable-class-library
Filter by
Sorted by
Tagged with
1 vote
0 answers
82 views

Is there a way to get font measurements from within a PCL (Portable Class Library)?

I'm trying to find a way to get font measurements from within my PCL (Portable Class Library), however every resource I have come across to get font measurements seems to be platform specific. Is ...
michael's user avatar
  • 15k
0 votes
1 answer
208 views

Don't know how to add SSL certificate on Windows Phone 8.1 Portable Class Library

I tried in many ways to access to a HTTPS server using Windows.Web.Http.HttpClient on a portable class library for a windows phone 8.1 App I need a portable class library and install the ssl ...
Maxime Vincent's user avatar
0 votes
1 answer
351 views

Create a class library that will work on all windows platforms

I have a Class Library Project that I would like to make use of on the Windows Phone and Silverlight Apps (Windows 8.1). Effectively turn it into a Class Libary (Portable). My Class Library has a ...
Mike Eason's user avatar
  • 9,615
1 vote
1 answer
2k views

How to serialize an object into an array of bytes (Portable Class Library)

I have an object that I want to serialize into byte[] in order to save it or move it around. Let's assume it's: public class Message { public MessageType MessageType { get; set; } public ...
TheBlueSky's user avatar
  • 5,748
0 votes
1 answer
282 views

Using BindingList in Portable Library

So I figured out that binding a list control directly to a List<T> doesn't work all that well (property change notification doesn't seem to work) and that BindingList<T> should instead be ...
dotNET's user avatar
  • 34.4k
0 votes
0 answers
45 views

Unified local app storage across platforms including deployment and dev-testing

Although I have experience in C#, I am only just now starting to explore developing under Windows 8, Windows Phone, and Xamarin. I am attempting to write a Portable Class Library which will run on ...
philologon's user avatar
  • 2,093
3 votes
1 answer
615 views

Can I use System.Timers.Timer in an F# PCL library?

I need to use System.Timers.Timer in an F# PCL library. I'm currently targeting framework 4.5 and using Profile7 (I used the VS template) and it doesn't allow access to System.Timer. According to ...
Troy Kershaw's user avatar
9 votes
1 answer
4k views

What is the difference between OnStart and the App Constructor [duplicate]

Xamarin Forms has the following App class: public class App : Application { public App() { // The root page of your application MainPage = new ContentPage ...
Yoeri's user avatar
  • 2,249
1 vote
1 answer
1k views

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

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 ...
JSourp's user avatar
  • 35
0 votes
0 answers
177 views

Json.Net throwing strange error in Xamarin/MonoTouch Shared Library

I am creating a generic repository in a Shared Library project in a Xamarin/Monotouch solution. The repository connects to a REST service over http and receives json. I use json.net to deserialize my ...
Corstiaan's user avatar
  • 1,114
20 votes
1 answer
14k views

Portable Class Library vs. library project

I want to know the difference between PCL (Portable Class Library) and a normal library. PCL uses profiles with which it can be determined which platforms and features are available. Both can ...
testing's user avatar
  • 20k
0 votes
1 answer
50 views

ConcurrentExclusiveSchedulerPair in Xamarin iOS and Android fails

Does anyone know if there is anything special to using ConcurrentExclusiveSchedulerPair in a Xamarin iOS or Android project? Currently I have: private readonly ConcurrentExclusiveSchedulerPair ...
dannydwarren's user avatar
1 vote
1 answer
335 views

Nuget PCL library conflict

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 ...
rducom's user avatar
  • 7,202
0 votes
1 answer
136 views

FileInfo equivalent in code analysis in C#

I'm currently in the process of writing analysis code for my job. I have to "map" the code from FxCop to our own private framework. This is a bit of an issue, but not my main concern. I can't access ...
Kevin Avignon's user avatar
1 vote
1 answer
82 views

PCL : missing property

While migrating some code to a PCL targeting .Net4.5 / Silverlight5, the IgnoreCase property on ResourceManager class disappears. This property exists both in .Net4.5 and Silverlight5, so the "...
rducom's user avatar
  • 7,202
0 votes
0 answers
382 views

PCL equivalent of Environment.GetEnvironmentVariable?

Is there a Portable Class Library equivalent of Environment.GetEnvironmentVariable? If not, is there some way to detect if I'm on an environment that supports it and only call it in that scenario? I'm ...
Brannon's user avatar
  • 5,356
1 vote
1 answer
276 views

Equivalent of System.Xml.XmlAttribute in PCL land?

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....
Brannon's user avatar
  • 5,356
3 votes
1 answer
249 views

How to specify HttpWebRequest.Headers["Range"] in a PCL?

I'm writing a progressive downloader as a Portable Class Library (Profile=24). It will support partial downloads of target files in chunks of bytes. HttpClient not being available, I'm going with ...
Simon's user avatar
  • 453
1 vote
1 answer
1k views

Check if thread is main thread

I'm running some tests on our large app, and I see sometimes the UI thread doing stuff it was not supposed to, like DB/network/etc. I know of IMvxMainThreadDispatcher.RequestMainThreadAction, but I ...
Code Knox's user avatar
  • 1,175
1 vote
1 answer
1k views

Using F# & SQLite.Net.Async PCL To Create a Database Table

I am trying to create a table "Materials" using an F# project inside a C# Windows 8 App. This is probably more specific on the library (SQLite.Net.Async) but it I am not having much luck getting this ...
Joseph Montanez's user avatar
1 vote
1 answer
408 views

Add System-package to Xamarin PCL project

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....
maxl's user avatar
  • 13
0 votes
2 answers
3k views

How to preserve headers in the Flurl HttpClient

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 ...
Ralph Shillington's user avatar
4 votes
0 answers
161 views

Visual Studio Custom Item Templates for PCLs

I am trying to create an item template compatible with a PCL. This question has already been asked and answered but it appears that a later update to VS means the solution is no longer working. Link ...
Steven Bruce's user avatar
1 vote
1 answer
129 views

Registering a Portable PCL assembly in the Visual Studio Add References Dialog

In Visual Studio, the assemblies listed in the Add References dialog are registered by adding a Registry key to HKLM\SOFTWARE\Microsoft\.NETFramework\{VersionMinimum}\AssemblyFoldersEx\. ...
Rob Prouse's user avatar
  • 22.4k
9 votes
1 answer
4k views

Autogenerated XAML.g.cs files are not compilable in Xamarin Forms PCL project

I have a Xamarin forms (I'm using Xamarin Studio 5.7) project with a common PCL containing UI components. I was just using Classes (No XAML designers) to start my project and it works well, compiles, ...
jaskey's user avatar
  • 226
1 vote
0 answers
111 views

Xamarin Studio Rebuilds Every Time (PCL + iOS + MVVMCross)

Every time I start my iOS project, Xamarin Studio is building the code which takes about 40 seconds... even if I haven't changed any code/settings. Can someone point out what I've done wrong? Here are ...
SimonM's user avatar
  • 174
2 votes
0 answers
399 views

Xamarin MvvmCross projects - Project Not Built in Active Configuration

I have an iOS Solution which has an iPhone project and two other PCL libraries that contain my MvvmCross ViewModels and Model. I am using Xamarin Studio for Mac. When I select to build the solution ...
rideintothesun's user avatar
2 votes
1 answer
134 views

What framework and compiler directive to use for portable class libary in ASP.NET5?

What framework and compiler directive to use for portable class library in ASP.NET5? For framwwork, that "pcl" ? "pcl": { "frameworkAssemblies": { // ... }, "dependencies": { ...
Stef Heyenrath's user avatar
0 votes
2 answers
991 views

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

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?...
Wendy Lin's user avatar
3 votes
2 answers
2k views

RabbitMQ Client- Is there a portable class library version

Does anyone know if there is a portable class library (PCL) version of the RabbitMQ client libraries that could be used in the developmentof a Xamarin mobile application? If nor does anyone know of a ...
rideintothesun's user avatar
0 votes
1 answer
53 views

How to get access to Microsoft.Phone.Control in a 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?
AbsZero's user avatar
  • 65
1 vote
2 answers
153 views

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

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 ...
Zni's user avatar
  • 45
0 votes
1 answer
1k views

The type or namespace Http does not exist in the namespace 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....
Ralph Shillington's user avatar
2 votes
3 answers
1k views

Missing methods in PCL

I have a very generic database insert/query which works fine as a non-PCL method. I'm trying to move it over to a PCL project and for the majority of the code, there isn't a problem. However, I'm ...
Nodoid's user avatar
  • 1,499
1 vote
1 answer
267 views

Testing MvvmCross.Core projects

I have a solution with a Core and an Android project. I wish to create a Core.Tests project, to test my viewmodels. I add it as a Class Library (as described in http://slodge.blogspot.co.uk/2013/06/...
user1202032's user avatar
  • 1,459
53 votes
4 answers
56k views

How to send DELETE with JSON to the REST API using HttpClient

I have to send a delete command to a REST API service with JSON content using the HttpClient class and can't make this working. API call: DELETE /xxx/current { "authentication_token": "" } because ...
Tomasz Kowalczyk's user avatar
0 votes
1 answer
200 views

Hexadecimal clock in Portable Class Library c# [closed]

I want to create a class in the portable class library that manages the current time in true hexadecimal time, not simply sexagesimal time represented by hex digits. What is my best method of ...
user avatar
0 votes
1 answer
4k views

Assembly not found error in Xamarin Studio

Let me first start by saying, I'm not even sure what I'm trying to do is possible, and I'm very new to Xamarin/Monotouch development, but here goes. For some background, I'm looking for a Xamarin PCL ...
tobyb's user avatar
  • 726
5 votes
1 answer
406 views

How to create a F# PCL with Xamarin.Studio?

I see the template for creating a C# PCL, but not a F# PCL. Somewhere, someone mentioned about installing the necessary templates. Anybody knows better? About Xamarin Studio 5.9 Does anybody knows ...
Lay González's user avatar
0 votes
1 answer
2k views

await HttpClient.SendAsync not throwing exception when expected

I have a Windows Phone 8 app containing code as follows: using (var client = new HttpClient()) { var httpRequest = new HttpRequestMessage(method, uri); try { var response = client....
Zenilogix's user avatar
  • 1,376
0 votes
1 answer
328 views

Portable Class Library not compatible targets, but should be

I am trying to create a Portable Class Library which uses Autofac, but I am getting an installation error. I run Install-Package Autofac Which results in the following: Here are the targets of my ...
Phillip Scott Givens's user avatar
0 votes
0 answers
196 views

MarshalAs Attribute not supported in PCL for "Windows Phone Silverlight"?

When I add the "Windows Phone Silverlight 8 (or 8.1)" target to my portable class library, the compiler flags MarshalAs: error CS0246: The type or namespace name 'MarshalAs' could not be found (are ...
Uwe Reisewitz's user avatar
2 votes
1 answer
223 views

Cant Install PCLStorage using nuget

I have create a new Protable Class Library Project. I want it to have some IO functionality so I decided to use PCLStorage So In the Package Manager, I execute this command: Install-Package ...
Krimson's user avatar
  • 7,504
3 votes
1 answer
455 views

Updating nuget package to support xamarin unified

I am trying to get my pcl to build properly into a nuget package. I have updated to the xamarin beta and I have updated nuget to version 2.8.5 however I am getting the following error when creating my ...
Bjarke's user avatar
  • 1,285
-1 votes
1 answer
149 views

Any changes needed to Visual Basic PCL for Xamarin Unified API?

I have a Visual Basic PCL for Xamarin. Will I need to make any changes to the PCL to be able to use it in a Xamarin Unified API project? Or just recompile perhaps? I read that Visual Basic code ...
BillF's user avatar
  • 1,076
12 votes
2 answers
7k views

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

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 ...
dbruning's user avatar
  • 5,082
6 votes
2 answers
6k views

How to solve xbuild '.NETPortable,Version=v4.0,Profile=Profile344' issue on Linux

I tried to compile my project with following instructions so I get following error. My script; sudo apt-get install mono-complete mozroots --import --sync mkdir gthb cd gthb/ git clone https:/...
ziyasal's user avatar
  • 558
0 votes
1 answer
405 views

How to store user credentials in portable apps?

Windows Runtime (WinRT/8) has a PasswordVault service which implements storage for user passwords and etc. But what about Xamarin's Android, iOS and WinPhone SDKs? Application that use encryption, if ...
Croll's user avatar
  • 3,711
1 vote
1 answer
427 views

How does one access embedded solution files in a PCL class

I'm trying to read PCL content file that I'm adding with the resource. the ideal use case for this is a REST service mock where I want to host a few json files for testing the Network services. I want ...
Jay Kannan's user avatar
  • 1,274
3 votes
3 answers
160 views

date computations in a PCL

I see that the GregorianCalendar class is not available in a C# Portable Class Library. I want to do some calendar calculations -- how many months, weeks, and days, have passed between two dates. Is ...
William Jockusch's user avatar

1
12 13
14
15 16
29