portable-class-library

How does the C# compiler decide to emit retargetable assembly references?

僤鯓⒐⒋嵵緔 提交于 2019-12-04 02:08:54
Retargetable assembly references have been introduced for the .NET Compact Framework and are now used to support Portable Class Libraries. Basically, the compiler emits the following MSIL: .assembly extern retargetable mscorlib { .publickeytoken = (7C EC 85 D7 BE A7 79 8E ) .ver 2:0:5:0 } How does the C# compiler understand it has to emit a retargetable reference, and how to force the C# compiler to emit such reference even outside of a portable class library? For the assembly itself, it's an assembly flag, ie [assembly: AssemblyFlags(AssemblyNameFlags.Retargetable)]. Make note that this flag

Thread.Sleep() in a Portable Class Library

你。 提交于 2019-12-03 23:51:25
The MSDN docs say Thread.Sleep() can be used in a portable class library. The compiler says otherwise. What are my alternatives besides a spin-loop? Thread.CurrentThread.Join() doesn't exist either. Project file: <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{C46B138E-CC30-4397-B326-8DD019E3874B}</ProjectGuid> <OutputType

Automating Nuget Package Push With .NetCore RC2

有些话、适合烂在心里 提交于 2019-12-03 20:42:46
I am currently working on a .NET Core library that I am going to use as a NuGet package in another project. I have been able to successfully package the project using the "dotnet pack" command in the project directory, and upload that package to MyGet. I would prefer to automate this process of pushing the NuGet package by using the "nuget push" command. My issue is that the "scripts" property defined in the project.json file does not seem to be executed on pack or build. I expected that these scripts would be executed when the corresponding event occurs, but they seem to have no effect as I

Class libraries in VS 2015 - Building Cross Platform Libraries

我的未来我决定 提交于 2019-12-03 16:34:32
问题 There are different class libraries I can create in VS 2015 with Xamarin installed: Class Library Class Library (Android) Class Library (Package) Class Library (Portable for Universal Apps) Class Library (Portable) Class Library (Xamarin.Forms) I would love to know the difference between each - just a brief would do :) The Scenario Our team is currently developing a new project which we are targeting for multiple platforms - web and mobile (Xamarin) primarily. While we decided to focus on the

Why Activity Indicator Not working In Xamarin.forms?

十年热恋 提交于 2019-12-03 16:07:18
I am trying to display ActivityIndicator After I press a button while I am trying to update The Column Field On DataBase, it is not appearing? What is the problem? On the following My Code: ActivityIndicator ai = new ActivityIndicator() { HorizontalOptions = LayoutOptions.CenterAndExpand, Color = Color.Black }; ai.IsRunning = true; ai.IsEnabled = true; ai.BindingContext = this; ai.SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy"); ProcessToCheckOut = new Button { Text = "Set Inf" }; ProcessToCheckOut.Clicked += (object sender, EventArgs e) => { this.IsBusy = true; UserUpdateRequest

Disable autocomplete in Xamarin.Forms PCL XAML Page

时间秒杀一切 提交于 2019-12-03 12:15:59
I have a PCL which stores my MVVM pages in XAML. I have the following in the XAML file, but I'd like to disable the autocomplete feature on the keyboard. Does anyone know how I can do this in the XAML? <Entry Text="{Binding Code}" Placeholder="Code" /> Forms supports a KeyboardFlags.Suggestion enum which I assume is intended to control this behavior, but it doesn't appear to be very well documented. Taylor Buchanan Custom Keyboard instances can be created in XAML using the x:FactoryMethod attribute. What you're wanting can be achieved with the following markup: <Entry Text="{Binding Code}"

Implementing custom exceptions in a Portable Class Library

孤人 提交于 2019-12-03 10:10:25
When designing custom exceptions for .NET, MSDN provides these guidelines . In particular, the guidelines state that a custom exception: should be serializable, i.e. implement ISerializable and be decorated with the [Serializable] attribute, and should implement the (de)serialization constructor, i.e. protected CustomException(SerializationInfo info, StreamingContext context) . However, in a Portable Class Library neither of SerializableAttribute , ISerializable and SerializationInfo are supported. How should I sufficiently design a custom exception in a Portable Class Library that

MonoTouch: creating multiplatform apps using Portable Class Libraries

故事扮演 提交于 2019-12-03 08:29:35
My scenario: trying to port a small part of an application created by our company from native code (ObjC for iOS / Java for Android) to C-Sharp. The project will interact with our webservices. Goal of this project is figuring out how feasible it is to port our whole app to Mono. To create URLs, I'd like to use String.Format() . I thought it'd be a wise idea to put this 'service layer' inside a Portable Class Library (PCL) since I don't expect this code to change across platforms. Sadly, it seems the String library is not available for PCLs. So my question is the following: I think the main

Class libraries in VS 2015 - Building Cross Platform Libraries

怎甘沉沦 提交于 2019-12-03 05:55:11
There are different class libraries I can create in VS 2015 with Xamarin installed: Class Library Class Library (Android) Class Library (Package) Class Library (Portable for Universal Apps) Class Library (Portable) Class Library (Xamarin.Forms) I would love to know the difference between each - just a brief would do :) The Scenario Our team is currently developing a new project which we are targeting for multiple platforms - web and mobile (Xamarin) primarily. While we decided to focus on the MVC web app first, we want to create a single project to contain all models and business classes

Can I build an “old school” PCL with DNX/DNU?

泪湿孤枕 提交于 2019-12-03 04:14:05
In Noda Time 1.3.1, our .csproj file referred to Profile 328 and our .nuspec file put the results in lib\portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1+XamariniOS1 For Noda Time 2.0, I've moved everything over to DNX/DNU (soon to be dotnet cli, of course). However, we now want to build a regularly-updated package containing the latest time zone information from IANA . We'll build one version of that with a dependency on Noda Time 1.3.1, and another version with a dependency on Noda Time 2.0.0. I would like to do all of this still within DNX/DNU, but it's unclear to me whether