.net-core-2.0

Which C# version .NET Core uses?

拈花ヽ惹草 提交于 2019-12-04 22:30:52
I know that C# version depends on .NET Framework . But .NET Core which version uses? Particularly .NET Core 2? C#7? .NET Core 2.0 references Roslyn 2.3, which corresponds to Visual Studio 2017 version 15.3 and supports C# 7.1. The C# what's new version history page gives a list of all versions plus their associated Visual Studio and .NET core version: C# 7.3 Visual Studio 2017 version 15.7, and in the .NET Core 2.1 SDK 2.1.300 RC1 C# 7.2 Visual Studio 2017 version 15.5, and in the .NET Core 2.0 SDK. C# 7.1 Visual Studio 2017 version 15.3, and in the .NET Core 2.0 SDK. C# 7.0 Visual Studio 2017

AddOAuth linkedin dotnet core 2.0

天涯浪子 提交于 2019-12-04 19:50:42
问题 I'm using dotnet core I want to setup a LinkedIn authentication on the site since there is no default authentication builder for LinkedIn as facebook, google and twitter I decided to use the generic implementation as follows: services.AddAuthentication().AddOAuth("LinkedIn", c => { c.ClientId = Configuration["linkedin-app-id"]; c.ClientSecret = Configuration["linkedin-app-secret"]; c.Scope.Add("r_basicprofile"); c.Scope.Add("r_emailaddress"); c.CallbackPath = "/signin-linkedin"; c

How to compile Typescript files on VSTS build server for .Net Core 2 projects

本秂侑毒 提交于 2019-12-04 12:15:30
I've been trying to get my TypeScript files compiled to JavaScript files in my CI build process on VSTS. Once the JavaScript files have been generated then my gulp file process can process them to the wwwroot folder. The project builds fine in Visual Studio 2017 with VS obeying the tsconfig.json file by compiling the file on change and then the Task Runner running the gulp file on detected changes and build. All the correct files are genereated when building or publishing locally in Visual Studio. When trying to set up my build process in VSTS as part of my CI/CD process the C# code is built

How to hide .NET Core compatibility warnings when referencing .NET 4.6 NuGet package in VS 2017.3

巧了我就是萌 提交于 2019-12-04 09:24:50
I'm working on a .NET Core CLI app that needs to reference a 3rd party NuGet package that has not been published with a netcoreappX.X target. I've run the Analyze Project Portability tool on it and got 100% compatibility, which is expected, as this is a relatively simple library. The problem then comes in the form of this annoying NuGet warning: Warning: NU1701 Package 'XXXXXX 1.0.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project. Is there a way to hide this warning

Published .Net Core 2 application does not read appsettings.json file

天大地大妈咪最大 提交于 2019-12-04 05:58:42
问题 I have 2 apps, one console one web api both .net core v2.0 . Both has the same problem. I used to run my application thru source files. I was building and running them on a linux machine. Everything was good, everything was great, but now i'm running the same app thru publish output. Now it doesn't work as it suppose to, because the app can't read appsettings.json. configuration["Settings:Port"] != null ? int.Parse(configuration["Settings:Port"]) //i should be getting this - 1234 : default

.NET Core 2 and SwashBuckle Swagger UI is not Displaying

谁说我不能喝 提交于 2019-12-04 03:36:16
I have followed a few tutorials and have gotten this to work at work but for some reason I am not able to get the UI to display but the Swagger Json is created. Last tutorial I looked at is here . My setup is like so: Nuget Package: Swashbuckle.AspNetCore(1.0.0) ConfigureServices Method: services.AddSwaggerGen(options => { options.SwaggerDoc("v1", new Info { Title = "MediatR Example", Version = "v1", Description = "Trying out the MediatR library to simplify Request and Response logic.", TermsOfService = "WTFPL", Contact = new Contact { Email = "", Name = "", Url = "https://github.com

netcore not logging to console

梦想与她 提交于 2019-12-03 23:55:18
问题 I have a simple test project to experiment with logging with NetCore 2.0 using the Microsoft Logging Extensions package. The problem I'm having is that when I run my app the very first time, it logs informational messages as expected. The weird behavior I'm having though is that subsequent runs won't produce any messages at all. My project targets the Net Core 2.0 framework, and has the following NuGet packages installed: Microsoft.Extensions.Logging Microsoft.Extensions.Logging.Abstractions

AddOAuth linkedin dotnet core 2.0

喜夏-厌秋 提交于 2019-12-03 12:47:07
I'm using dotnet core I want to setup a LinkedIn authentication on the site since there is no default authentication builder for LinkedIn as facebook, google and twitter I decided to use the generic implementation as follows: services.AddAuthentication().AddOAuth("LinkedIn", c => { c.ClientId = Configuration["linkedin-app-id"]; c.ClientSecret = Configuration["linkedin-app-secret"]; c.Scope.Add("r_basicprofile"); c.Scope.Add("r_emailaddress"); c.CallbackPath = "/signin-linkedin"; c.AuthorizationEndpoint = "https://www.linkedin.com/oauth/v2/authorization"; c.TokenEndpoint = "https://www.linkedin

Blazor: Implementing 404 not found page

末鹿安然 提交于 2019-12-03 08:28:49
I'd like to implement a page internal to my application that appears when the blazor router is unable to find a matching route. Currently, all requests are routing to index.html so I'm unable to handle errors through iis as I may normally. If I enter an invalid route, I will be shown a blank page (which is actually index.html ) and receive a console error: 'Router' cannot find any component with a route for '/some/Nonexistent/Route'. It seems like I should be able to handle this since the blazor router is able to recognize that there is no route defined which matches the requested route

Upgrading to .NET Core 2.0: PackageTargetFallback and AssetTargetFallback cannot be used together

笑着哭i 提交于 2019-12-03 08:04:08
问题 When upgrading a project that is compiling and running fine on .NET Core 1.0 or 1.1, updating the target framework to .NET Core 2.0 ( netcoreapp2.0 ) causes the build to fail with the following error: error NU1003: PackageTargetFallback and AssetTargetFallback cannot be used together. Remove PackageTargetFallback(deprecated) references from the project environment. What is the reason for this error and how can it be resolved to make the project build again? 回答1: In .NET Core 1.0 and 1.1, it