portable-class-library

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

不打扰是莪最后的温柔 提交于 2019-12-21 10:16:48
问题 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

Is System.Security.Cryptography namespace supported by the Portable Class Library

被刻印的时光 ゝ 提交于 2019-12-21 09:06:22
问题 I am converting an existing multi-target Silverlight/.NET project to a Portable Class Library project in order to reduce the number of projects that are required to support multiple Microsoft platforms. I have an error in one class that is using the System.Security.Cryptography namespace The type or namespace name 'Cryptography' does not exist in the namespace 'System.Security' (are you missing an assembly reference?) This namespace is available in Silverlight and I am wondering why the

Automating Nuget Package Push With .NetCore RC2

浪尽此生 提交于 2019-12-21 05:41:20
问题 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

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

我与影子孤独终老i 提交于 2019-12-20 16:10:36
问题 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

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

浪尽此生 提交于 2019-12-20 11:03:32
问题 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 I can't add any content into below statement: HttpResponseMessage response = client.DeleteAsync(requestUri).Result; I know how to make this work with RestSharp: var request = new RestRequest { Resource = "/xxx/current", Method = Method.DELETE, RequestFormat = DataFormat.Json }; var jsonPayload =

Creating a class library in visual studio code

假如想象 提交于 2019-12-20 10:23:48
问题 It might be a silly question, Let's say I don't have a Windows OS, have a Linux. I have created a .Net core console app, also want to create a class library and reference it in console app. I can't find if i am able to do it also couldn't find a sample on Microsoft .Net core page. Is there an extension in vs code? Or isn't it possible with it? If i am mistaken could you please guide me? 回答1: The best way to do it is from the console, since you are using the latest supported templates this way

Xamarin.Forms Portable Class Library Project with Sharp.XMPP library

╄→尐↘猪︶ㄣ 提交于 2019-12-20 06:38:18
问题 an specific issue has occured in my project. I've found only one library for C# supporting Android (in Xamarin): Sharp.XMPP, NuGet, but I have troubles with it. When I write some sample code in separated portable class library, I get these errors: Error 1: '.ctor' is not supported by the language by the line using (XmppClient client = new XmppClient(hostname, username, password)) { ... } Next: Error 2: Metadata file '...\Project.Jabber.dll' could not be found Warnings 2-6: Reference to type

How to use PCL in ASP.NET Core 1.0 RC2 project

时光毁灭记忆、已成空白 提交于 2019-12-20 01:41:47
问题 I want to use a simple (POCO only without other dependencies) PCL with targets Xamarin.Android Universal Windows 10 ASP.NET Core 1.0 in an ASP.NET Core 1.0 RC2 project (all in the same solution). I have added this import to my project.json: "frameworks": { "netcoreapp1.0": { "imports": [ "dotnet5.6", "dnxcore50", "portable-net451+win8" ], "dependencies": { "PCL.Library": { "target": "project" } } } } I don’t get any errors (compilation or otherwise) and the PCL.Library project shows up in the

Trying to install EF Core with Portable Class Library targeting .Net 4.6.1

Deadly 提交于 2019-12-19 08:10:24
问题 This is my first time experimenting with EF Core, ASP Net Core and Portable Class Libraries with VS2015. Fair to say I am getting frustrated. I want to create a library where I can install EntityFramework.Core. This library needs to be used in a WPF Application and an ASP NET Core Web Application - ignoring any good layered application concepts for now. My thought was to create a Portable Class Library. Using the project template where I target .NET 4.6 and ASP Net Core... I get a project

Using Async CTP with Portable Class Library

被刻印的时光 ゝ 提交于 2019-12-19 07:23:51
问题 I am trying to rewrite a project into a Portable Class Library. But the problem is that it is using Async CTP, and I can't compile it as a library for WP and Windows Store App. If I don't include reference AsyncCtpLibrary.dll, compiler says that The type or namespace name 'Tasks' does not exist in the namespace 'System.Threading' (are you missing an assembly reference?) If i include it, compiler still says the same errors and adds a warning: The primary reference "AsyncCtpLibrary" could not