portable-class-library

Invalid il code System.IO.Compression.ZipFile.OpenRead() Method body is empty

倖福魔咒の 提交于 2019-12-07 22:32:47
问题 I 'am implementing an android app using Xamarin and MVVMCross. Inside my PCL I have a ZipUtility class and the following method: public NoDataResponse UnCompressZipFile(string path, string filename) { NoDataResponse response = new NoDataResponse(); StringBuilder sb = new StringBuilder(); sb.AppendLine(string.Format("\r\nUnzipping '{0}' in '{1}' folder...", filename, path)); try { using (ZipArchive archive = ZipFile.Open(filename, ZipArchiveMode.Read)) { foreach (System.IO.Compression

Secure WCF binding in a Portable class library with Xamarin

北城以北 提交于 2019-12-07 14:51:20
问题 I have a WCF service that has a WSHttpBinding . Unfortunately in my PCL for some reason I cannot use WSHttpBinding . I can only use BasicHttpBinding . Is there a way that I can use a secure binding in a portable class library? I am using Xamarin. 回答1: from Here I read about transport security: Transport Security When using transport security, the user credentials and claims are passed by using the transport layer. In other words, user credentials are transport-dependent, which allows fewer

Prevent system FontSize change from affecting the size in the Xamarin Application

左心房为你撑大大i 提交于 2019-12-07 12:44:46
问题 So I noticed that an App I made will look messed up if the Font size in the users phone is changed to above medium, I googled a bit found many unanswered or answered but not to the point of the same question. I want to be able to do that in the PCL class if possible , if not possible then the most interesting platform for me is android so a fix specific for android would do. Here is a sample of my Xaml code so you can get a reference: <Label Text="STORE" FontSize="23" HeightRequest="40"

Create a SQLite Database in Windows Phone 8.1 Class Library

≡放荡痞女 提交于 2019-12-07 11:34:29
问题 I have a Windows Phone 8.1 Class Library that I want to later add as a reference to a Windows Phone 8.1 App project. This ClassLibrary should be responsible for creating and managing its own database. I tried creating a new SQLiteConnection in my ClassLibrary, but it throws the following error: A first chance exception of type 'System.InvalidOperationException' occurred in SQLitePCL.DLL however, if I do the same in my MainApp everything works fine. So, is it possible to create a SQLite

Why can't I use await keyword in my Windows Phone 7.1 MvvmCross project while using the Microsoft.Bcl - cannot await 'System.Threading.Tasks.Task?

老子叫甜甜 提交于 2019-12-07 10:21:18
问题 I am unable to use the await keyword in my MvvmCross Windows Phone 7.1 project while using the Microsoft.Bcl "Microsoft BCL Portability Pack". I have posted the code for the sample project that I describe below on GitHub and the await error occurs on this line. When I try to build the third "Core" Windows Portable Class Library (PCL) that contains the FirstViewModel, I get the errors of: Type System.Threading.Tasks.Task<string> not awaitable under VS red squiggles, and Cannot await 'System

How to connect with SQL Server database using .NET Core Class Library (.NET Standard)?

狂风中的少年 提交于 2019-12-07 06:10:46
问题 I have just started to create an ASP.NET Core Web API Project. I am not much aware of "ASP.NET Core .NET Standard Library". I am creating this application using Visual Studio 2017 RC and in the application, I have taken a project of type Class Library (.NET Standard) at repository layer. Following is the screenshot for the same: Now from repository Layer I want to connect to the database. I have created a variable IDbConnection con; Now I am trying to add reference of System.Data but I am

NuGet and Portable Class Libraries - Package doesn't target any framework

╄→гoц情女王★ 提交于 2019-12-07 05:25:34
问题 I have been using NuGet to manage my internally created assemblies for a few months, and it's working very well. I recently 'discovered' portable class libraries, which has also been great - until it's time to install the packages. Say I have a PCL that targets .NET 4.5, SL5 and .NET for Windows Store Apps. I run nuget spec to create the .nuspec file, edit the values, package it up, and add the .nupkg to our internal feed. If I open the .nupkg file in the Package Explorer, I see one content

How can I replace Marshal.SizeOf(Object) with Marshal.SizeOf<T>()?

泄露秘密 提交于 2019-12-07 04:40:50
问题 I am building a Universal class library from existing code, and I get some compiler warnings that I for the life of it cannot figure out what to do with. I have code like this: void SomeMethod(Object data) { var size = Marshal.SizeOf(data); ... } The code builds, but in the Universal project (and, I guess, .NET 4.5.1 and higher projects) I get the following compiler warning: warning CS0618: 'System.Runtime.InteropServices.Marshal.SizeOf(object)' is obsolete: 'SizeOf(Object) may be unavailable

The type or namespace name 'Core' does not exist in the namespace 'AuntieDot'

a 夏天 提交于 2019-12-07 03:53:59
问题 I have 4 PCL's, and they are all targeted at the same Frameworks: AuntieDot: AuntieDot.Authentication: AuntieDot.Core: AuntieDot.Models: But for some reason, the usage of 'AuntieDot.Core.Helpers' in the 'AuntieDot.Authentication' namespace (despite 'AuntieDot.Core' being added as a reference into 'AuntieDot.Authentication', it's saying it doesn't exist. I've googled around and the only replies I've gotten is that I need to make sure the other libraries are targeted at the same frameworks,

Progress bar for HttpClient uploading

℡╲_俬逩灬. 提交于 2019-12-07 01:33:17
问题 I want to run asynchronous uploads with a progress bar in WPF (and preferably use PCL for code reuse in Xamarin and SL too.) I've been trying to use System.Net.HttpClient. Unfortunately, PutAsync doesn't provide any progress notifications. (I know that it does for Windows.Web.Http.HttpClient, but that's not available for WPF, nor in the PCL). For downloading, its fairly easy to implement your own progress bar, as described here. You just pass the ResponseHeadersRead option, which makes the