portable-class-library

What modern (PCL) equivalent for Handshake.XOnXOff?

旧城冷巷雨未停 提交于 2019-12-25 03:10:31
问题 I was using this legacy code: SerialPort serialPort = new SerialPort(); serialPort.BaudRate = 19200; serialPort.Handshake = Handshake.XOnXOff; ...but trying to port it to VS 2013 / .NET 4.5.1 in the "Core" (Portable Class Library) portion of a Xamarin solution, I get, " The name 'Handshake' does not exist in the current context " According to this, the Handshake enum is in System.IO.Ports namespace, but adding that to my usings evokes " The type or namespace name 'Ports' does not exist in the

Path, FileInfo, etc. in PCL (Profile 158)

只谈情不闲聊 提交于 2019-12-25 02:31:50
问题 I can concatenate files and paths, but how do I check for file existing using PCL (Profile 158). Is it possible? 回答1: Platforms such as Windows Store and Silverlight don't support those APIs. Those platforms have APIs such as Windows.Storage and IsolatedStorage which allow access to storage. You can use my PCL Storage library or something similar to access those different APIs in a portable fashion. 来源: https://stackoverflow.com/questions/20555484/path-fileinfo-etc-in-pcl-profile-158

Portable class library and resx localization

痴心易碎 提交于 2019-12-24 17:14:35
问题 I have Portable class library, where I have resx files containing localization strings (Resources.resx, Resources.en.resx, Resources.de.resx ). Then I use this resources in the PCL LocalizationViewModel in this way : public string SettingsLogin { get { return Resources.Settings_Login; } } Language switching code looks like following : In PCL CultureInfo.DefaultThreadCurrentCulture = new CultureInfo(lang); CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo(lang); Resources.Culture =

MEF 2 Composition with .NET 4.5, Windows Store PCL

假装没事ソ 提交于 2019-12-24 13:50:37
问题 I am having trouble getting MEF to satisfy an import and could use some help. Unfortunately, the problem only manifests in a production code base. I tried to simplify the problem so I could post an example and see where my lack of understanding is, but the simplified version worked. So this is either I am missing the difference (and I have done my best to look thoroughly at the two), or the complexity is needed to reproduce. I have a WPF application consuming .NET 4.5 class libraries and

Are there any symbols when compiling a portable class library that can be used with preprocessor directives

笑着哭i 提交于 2019-12-24 12:08:30
问题 I have added a portable class library to my solution in which has a global file that is linked to all the projects. This global file contains the assembly level attributes such as version, culture, and Com visibility. The problem I want to solve is that some attributes such as ComVisible are not valid in the context of a PCL so is there any symbol that used with #if to prevent that attribute for being included at build time? 回答1: I overcame this issue by adding stub/dummy attribute classes to

Alternative for SortedSet<T> in Portable Class Library?

断了今生、忘了曾经 提交于 2019-12-24 10:51:13
问题 Are there any alternatives in PCL for SortedSet<T>? Or must I implement my own? I need an indexed list of non-duplicated strings that I can search through within a PCL that supports .NET 4.0. My current workaround is to rely on a List<T> object, call its Sort method and use BinarySearch method. It works, but I was hoping I could do better. 回答1: There are no "Sorted" collections in that PCL profile. So, you'd either have to call the Sort method on another collection to get it sorted or write

UWP App Compilation Error PRI175 with 0xdef00071

≡放荡痞女 提交于 2019-12-24 08:10:13
问题 We have a UWP app which is referring some UWP class libraries and some Portable Class Library (PCL) libraries. Recently we have converted some of these PCL libraries to .NET Standard 2.0 project and post to that, we are getting the below error on compiling the UWP app. error PRI175 : 0x80070002 - Processing Resources failed with error : The system cannot find the file specified. GENERATEPROJECTPRIFILE : error PRI252: 0xdef00071 - File <UWP Class Library Project Folder>\bin\x64\Debug\<UWP

.NET Standard over PCL Xamarin.Forms.Core project

百般思念 提交于 2019-12-24 02:23:14
问题 I'm reading that .NET Standard is now preferred over PCL class libraries to share code. My question is should I use a .NET Standard library over a PCL for the core of a Xamarin Forms solution? Currently, it will target iOS and Android, but we are looking to Tizen for TV in the future. 回答1: .NET Standard will be the future, so if you can you should get on board now. But be aware. If you're planning on using NuGet packages you could run into the situation that a package (or library from another

Can you use DataSet and DataTables in a Portable Class Library

瘦欲@ 提交于 2019-12-24 01:19:24
问题 I am working on a project that relies on DataSet and DataTable. We wish to move into cross platform so are looking at Portable Class Libraries. However we cant find out how to use DataSet and DataTable in a portable class library. Are they available? Maybe we should be moving away from DataSets and DataTables but we have what we have right now. 回答1: No the Dataset and DataTable are quite Windows specific Data structures, they would not be cross compatible, you may instead plan to serialize

Using a custom version of FSharp.Core.dll

夙愿已清 提交于 2019-12-23 19:33:34
问题 I've been poking around with the fsharp compiler source code to try to build a wp7 version of FSharp.Core (FSharp.Core for Windows Phone 7.1 and F# 3.0), and at one point I gave up and started trying to make the portable version work with wp7 instead. I added the FX_NO_STRUCTURAL_EQUALITY define to the portable-net4+sl4+wp71+win8 target framework, which seems to what's causing it to not work at runtime, and tried to replace the FSharp.Core.dll in C:\Program Files (x86)\Reference Assemblies