.net-standard

Identity in ASP.NET MVC Framework using Identity Core

♀尐吖头ヾ 提交于 2019-12-23 04:22:54
问题 I am having trouble with switching partially to .NET Standard. I am in the process of migrating a class library to .NET Standard, in this library I have the repositories and the database communication. I already migrated this successfully to use AspNetCore.Identity.EntityFrameworkCore . What I try to achieve is eventually having 1 .NET Standard project taking care of the database, where 1 MVC .NET Framework, 1 API .NET Framework and 1 new .NET Core application will be using it. Besides that a

Best practice to include console app in NuGet

谁说我不能喝 提交于 2019-12-23 04:16:08
问题 I'm developing an open-source library which mainly consists of one class-library project targeting .NET Standard 2.0. On top of that, I've also implemented a console app which is the CLI to this library. The console project (for historic reasons) only targets .NET Framework 4.6.2. Now I wonder what would be the best practice in order to make this console app available to the community. On the broadest level, I see two possibilities: Ship the console app as a separate NuGet. Ship the console

How to use netstandard libs in xamarin iOS?

人走茶凉 提交于 2019-12-23 04:14:18
问题 Every time I add a reference to netstandard only library I get following error. Libs that specifically target xamarinios10 works just fine. error CS0012: The type System.Object' is defined in an assembly that is not referenced. Consider adding a reference to assembly System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' For example adding AutoMapper library to fresh "iOS Library" project does not work. It also does not work for any of my own NuGet packages

Web Api 2 run-time error when trying to use .netstandard 2 assembly

时间秒杀一切 提交于 2019-12-22 18:43:23
问题 I have an Asp.net WebApi 2 site referencing .net 4.6.1. Up till now the site was referencing a PCL assembly (portable class library), for compatibility with UWP & Xamarin, without issues. Now I am trying to change that PCL to a NetStandard2.0 assembly, as recommended, but am receiving an error at site start up. The error is below - Method not found: 'System.Collections.ObjectModel.Collection`1 System.Web.Http.HttpConfiguration.get_MessageHandlers()'. Any ideas? Thanks 回答1: I was getting the

Web Api 2 run-time error when trying to use .netstandard 2 assembly

偶尔善良 提交于 2019-12-22 18:43:02
问题 I have an Asp.net WebApi 2 site referencing .net 4.6.1. Up till now the site was referencing a PCL assembly (portable class library), for compatibility with UWP & Xamarin, without issues. Now I am trying to change that PCL to a NetStandard2.0 assembly, as recommended, but am receiving an error at site start up. The error is below - Method not found: 'System.Collections.ObjectModel.Collection`1 System.Web.Http.HttpConfiguration.get_MessageHandlers()'. Any ideas? Thanks 回答1: I was getting the

How to get real running process name?

最后都变了- 提交于 2019-12-22 12:27:24
问题 In a .NET core console app, I'd like to get the running process name, I used ProcessName as the docs say, but it always returns dotnet as the process name, not the actual underline dll that is running. Although it is a dll, this is a console app, not a library. Console.WriteLine(Process.GetCurrentProcess().ProcessName); output dotnet 回答1: EDIT: For .net core you could use: System.Reflection.Assembly.GetEntryAssembly().FullName or System.Reflection.Assembly.GetEntryAssembly().GetName().Name

Debugging - Referencing .NET standard 1.4 libraries in Xamarin.Forms Android application (VS 2017)

对着背影说爱祢 提交于 2019-12-22 10:26:25
问题 I use VS 2017. I have Xamarin.Forms Android project and I have to reference bunch of .NetStandard 1.4 libraries there. I have all projects in one solution. I basically added references and compiled solution with no problem. When I call from Xamarin method contained in .Net Standard library, it returns result but no breakpoint is hit inside that method. Also VS 2017 intellisense is not working for methods contained in .NetStandard libraries. Do I have to do something extra to enable debugging

Could not load file or assembly 'System.ComponentModel.Annotations' in published .Net 4.6.1 project referencing .Net Standard library

回眸只為那壹抹淺笑 提交于 2019-12-22 06:27:12
问题 PLEASE NOTE : This is not a duplicate of Could not load file or assembly 'System.ComponentModel.Annotations, Version=4.1.0.0. Unlike the issue linked, this issue occurs only after publishing the application. As you will see below, I have tried every solution proposed in that post with no success. This issue occurs in a WPF .Net Framework 4.6.1 project which references a .Net Standard 2.0 library which itself references the System.ComponentModel.Annotations NuGet package. The issue is

Could not load file or assembly 'System.ComponentModel.Annotations' in published .Net 4.6.1 project referencing .Net Standard library

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 06:26:26
问题 PLEASE NOTE : This is not a duplicate of Could not load file or assembly 'System.ComponentModel.Annotations, Version=4.1.0.0. Unlike the issue linked, this issue occurs only after publishing the application. As you will see below, I have tried every solution proposed in that post with no success. This issue occurs in a WPF .Net Framework 4.6.1 project which references a .Net Standard 2.0 library which itself references the System.ComponentModel.Annotations NuGet package. The issue is

VS 2017 RC : I Can not update NETStandard.Library in Nuget

谁说我不能喝 提交于 2019-12-22 01:43:34
问题 From the last (or maybe the two last) update, I can't update the package NETStandartLibrary in Nuget. I just create a new standard library project. See this message : In project's properties, the version is different : And in the .csproj : <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netstandard1.4</TargetFramework> </PropertyGroup> </Project> In Nuget, I add the dependency 'Microsoft.EntityFrameworkCore', then I got the warning : Warning Detected package downgrade: