.net-standard-2.0

Calling Process.GetProcesses() inside a .NET Standard library from a UWP app

那年仲夏 提交于 2019-12-13 04:09:07
问题 I have a .NET standard library which is below: using System; using System.Diagnostics; using System.Runtime.InteropServices; namespace process_library { public class ProcessHandler { public ProcessHandler() { } [MTAThread] public Process[] GetProcesses() { return Process.GetProcesses(); } } } I then have a Template10 project with all the .net core stuff updated to the latest version (required to get it to build) and referenced my library. This all works so far. Inside my main view-model I

Xamarin form: Does this give limitation access the libraries

坚强是说给别人听的谎言 提交于 2019-12-13 03:39:58
问题 I have a problem with these packages which I wanted to use on my Xamarin form using .net standard 2.0 Package 'ExifLib.PCL 1.0.1' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. Package 'Microsoft.Bcl 1.1.6' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully

Incompatible .NET Standard assemblies that should have been compatible?

这一生的挚爱 提交于 2019-12-12 12:49:57
问题 I have a .NET Standard 2.0 DLL project. It has no other references, apart from NETStandard.Library 2.0.1 and all is fine. It is referenced by a WPF application and everything seems to work fine. Once I add a nuget package for System.Collections.Immutable 1.5.0 to the DLL project, a yellow exclamation mark appears on the Dependencies root of the Solution Explorer. (Hm... I now see that the exclamation remains even after I remove this package, but I guess this is a VS bug since everything

Xamarin.forms How can I show items next each other in a list

折月煮酒 提交于 2019-12-11 13:15:43
问题 I am currently developing an app using Xamarin.Forms with .Net standard sharing strategy. Everything is done in the shared project. (No device specifies designs). I try to bind a list of objects to a listview. I already show/fill the list with ItemsSource="{Binding Items}" The selected item is bound to the listview as well SelectedItem="{Binding SelectedApp}" . Each listItem is visualized as a frame with an image and a title. By using a datatemplate. What I try to achieve is make my listview

Cannot use Entity Framework in .NET standard 2 project

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 08:53:31
问题 How can I use Entity Framework, or something similar within a .NET Standard project? It appears as though EF is not supported in .NET Standard 2 which is really annoying! So I have tried using Microsoft.EntityFrameworkCore.SqlServer and icrosoft.EntityFrameworkCore.SqlServer.Design Whist I can install these packages, I cannot then add a model I get the error --------------------------- Microsoft Visual Studio --------------------------- The project's target framework does not contain Entity

How to determine the .NET platform that runs the .NET Standard class library?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 06:45:48
问题 .NET Standard Library — One library to rule them all. The .NET Standard Library functionality may vary depending on the .NET platform that runs it: .NET Framework .NET Core Xamarin How to check the .NET platform where the .NET Standard library currently runs? For example: // System.AppContext.TargetFrameworkName // returns ".NETFramework,Version=v4.6.1" for .NET Framework // and // returns null for .NET Core. if (IsNullOrWhiteSpace(System.AppContext.TargetFrameworkName)) // the platform is

.Net Standard 2.0 ConfigurationManager Doesn't Read Connection Strings

笑着哭i 提交于 2019-12-11 05:06:55
问题 I have a .Net Standard 2.0 Library. I've references System.Configuration.ConfigurationManager via NuGet and I've added an App.config file with two connection strings. When I break on the following line, I notice that ConnectionStrings only contains a single connection string which is neither of the connection strings I have in my App.Config (shown below). var foo = ConfigurationManager.ConnectionStrings["cs1"].ConnectionString; The single connection string which does appear in

Is it possible to reference .NET Framework library in a Xamarin.Forms app?

心已入冬 提交于 2019-12-11 00:34:28
问题 I have a Xamarin.Forms project (.NET Standard 2.0 library + Microsoft.NETCore.UniversalWindowsPlatform 6.0.7) and I would like to reference a .NET Framework 4.6.1 library. I added a reference to my Framework library in the .NET Standard 2.0 library, but this result in the error Cannot resolve Assembly or Windows Metadata file 'Type universe cannot resolve assembly: FrameworkLib, Version=1.0.10735.0, Culture=neutral, PublicKeyToken=null. I tried to add the reference to my FrameworkLib in the

Nuget Packager the default XML namespace of the project must be the MSBuild XML namespace in TFS 2017

♀尐吖头ヾ 提交于 2019-12-10 18:31:18
问题 I changed the project type I am packaging from .net framework v4.6 to .net standard 2.0, now the build definition is failing in Nuget packager step and I am getting this error message. [error]The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to

How to Reference Microsoft.VisualBasic in a .Net Standard Class Library?

我是研究僧i 提交于 2019-12-10 16:55:36
问题 I am attempting to utilize some of the static classes in the Microsoft.VisualBasic name space in a .Net Standard 2.0 Class library (the Financial.Rate function specifically.) This is a C# project and the library contains various financial functions and calculations. I know that simply adding the using Microsoft.VisualBasic; is not enough since I need to reference the actual dll. But I am not sure how to do this in a .net Standard Class library. I have tried adding the NuGet Package Microsoft