portable-class-library

Portable Class Library does not support System.IO, Why?

末鹿安然 提交于 2019-12-23 07:12:39
问题 I created a portable class library to be used in my Monodroid project . But the problem is that I need System.IO library but unfortunately I couldn't add it. I even tried to add it by Add Reference option but it was in vain. Why this happened ? How shall I do this ? 回答1: You can't use System.IO because it isn't a portable class library. System.IO makes calls which are specific to the OS it runs on (Windows), while the portable class library is ment to be cross-platform. The solution to what

I cannot create SQLiteConnection in PCL version of Sqlite.net on WP8

人走茶凉 提交于 2019-12-22 17:36:14
问题 I'm using a PCL version of Sqlite.net from https://github.com/oysteinkrog/SQLite.Net-PCL This code below doesn't work for some reasons on WP8: var sqliteFilename = Path.Combine(ApplicationData.Current.LocalFolder.Path, "MyDB.db3"); var db = new SQLiteConnection(new SQLitePlatformWP8CSharp(), sqliteFilename); And I am receiving this error: An exception of type 'SQLite.Net.SQLiteException' occurred in SQLite.Net.DLL but was not handled in user code Additional information: Could not open

Xamarin forms: Check if user inactive after some time log out app

↘锁芯ラ 提交于 2019-12-22 05:00:19
问题 Hi I am trying to build an application in xamarin forms using PCL. I am trying to logout user from my app if the app is idle more than 10minute or more. I tried it by events that are called on the time when app is about to go to sleep state. But if the device screentimeout is set for never timeout then maybe It will never go to sleep. So how can I achieve this. I am new to xamarin forms. And as I am building the app for all the platforms I am confused how to manage this timeout? 回答1: For now

Is there a RestSharp implementation that works with Portable Class Libraries?

落花浮王杯 提交于 2019-12-22 03:22:30
问题 When I try to add RestSharp to a portable class library project using nuget, I get the following: Could not install package 'RestSharp 104.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.0,Profile=Profile104', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. I assume then it is not supported? If that be the case anyone have any

TypeLoadException when using PCL in .NET application if called class contains [OnDeserialized] method

此生再无相见时 提交于 2019-12-22 03:21:13
问题 I am adapting an existing .NET class library to a Portable Class Library. I am using profile 78 (.NET 4.5, Windows Store 8, Windows Phone 8) in favor of profile 158 (which also targets Silverlight 5) because I want to be able to compile the unsafe code of the original library. The .NET library contains quite a lot of classes marked [Serializable] , so I have implemented a support PCL library containing a dummy SerializableAttribute implementation: public class SerializableAttribute :

Can I get a “sometimes portable” class library project to load in Visual Studio Express?

◇◆丶佛笑我妖孽 提交于 2019-12-22 01:13:56
问题 For Noda Time version 1.1, the main goal is to build a Portable Class Library flavour, primarily to support Windows Phone and Windows Store apps. This means losing some functionality, so we build a desktop configuration and a PCL configuration (for each of debug, release, and "signed release"). To avoid having to work with umpteen project files, all of the 6 configurations exist in the same project file. The project file is customized to generate a property called "Portability", which is set

Does MvvmCross work in Xamarin Studio?

Deadly 提交于 2019-12-21 17:48:49
问题 I'm having a time getting a straight answer on this, I've done a lot of searches and reading, and tried a lot of stuff. It sometimes sounds possible and other times only sounds possible by doing linking and what-not, which is something I'm trying to avoid. I'm a big fan of PCLs. I've created a solution using Visual Studio 2012, Xamarin, and MvvmCross which works great, I can deploy to an iOS device, a Droid device, Windows --- what have you. Visual Studio can build working applications that I

How come there's no IKernel implementation in Ninject.Portable

孤街浪徒 提交于 2019-12-21 17:29:47
问题 I use and fancy Ninject alot. I wonder why there is no "BasicKernel" in Ninject.Portable? Is implementing IKernel require any call that PCLs don't contain? I'm talking about simple scenario (about: Bind<If1>().To<Class1>() and Get<If1>() )? 回答1: The PCL version of Ninject is split into two libraries, Ninject.dll and Ninject.Common.dll as some of the code is platform-specific. Ninject cannot exist without its platform code. In order to use Ninject, you need to add the Portable.Ninject Nuget to

Portable Class Library assembly reference problems in MonoDroid and MonoTouch

我只是一个虾纸丫 提交于 2019-12-21 12:32:00
问题 I have problem in my project where I have PCL for .Net 4.5, Windows Phone 8, WinRT, MonoTouch and MonoDroid, when I try to build MonoDroid or MonoTouch project that have reference to that PCL errors are following: *Error 1 The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Error 2 The type 'System.Enum' is defined in an assembly that is not

Assembly.GetCallingAssembly isn't supported on WinRT, but is for portable class libraries?

[亡魂溺海] 提交于 2019-12-21 10:17:24
问题 I'm needing to get some meta-data about the assembly which calls my component. As such, using Assembly.GetCallingAssembly() seems to be a natural fit. However, I've found it works everywhere except for in Windows Store. Where it's supported: Phone 7.0+ .Net 1.0+ Portable Class Libraries However, where it's not supported is directly within a Windows Store application. I can make a portable class library and then call it from there inside of a Windows Store application, but I can't just put it