.net-5

Docker image for .net 5

本秂侑毒 提交于 2021-02-18 04:51:39
问题 Typically I use following images for .net core 3.1 and it works fine. FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build I have for experimental reason started a new .net 5 project and created dockerfile with following FROM mcr.microsoft.com/dotnet/core/aspnet:5.0-buster-slim AS base FROM mcr.microsoft.com/dotnet/core/sdk:5.0-buster AS build and have following issue: => ERROR [internal] load metadata for mcr.microsoft

Calling thirdparty container with .net core TestHost/TestServer via SSL: Bypass SSL Validation using Testservers CreateClient() method

别等时光非礼了梦想. 提交于 2021-02-11 08:02:20
问题 I am trying to add keycloak as a testcontainer to my .net core (5) integration tests using the dotnet-testcontainers library . My Problem is, I am struggling with HTTPS-Support having a container using self-signed certificates and TestServer-Class for my integration tests. To be precise, I am using Microsofts TestServer class to create real API requests with an in-memory config for using a keycloak-testcontainer with exposed port 8443 and its self-signed certificate. The Problem is: I can’t

Visual Studio 2019 showing yellow exclamation for .NET 5 Preview 8

好久不见. 提交于 2021-02-11 06:11:45
问题 I recently installed .NET 5 Preview 8 and created a new ASP.NET Core MVC project in Visual Studio 2019 16.8 Preview 2. For all the NuGet packages it is showing yellow exclamation mark. There are no compilation errors, no warnings. The application works fine. No errors. But VS keeps showing yellow exclamation. This problem comes only for .NET 5 projects. ASP.NET Core 3.1 projects don't give this problem. My project file is shown below : <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup>

ASP.NET Core (.NET 5) + Angular 11 = build error on empty project

假装没事ソ 提交于 2021-02-10 02:49:31
问题 If I create a new ASP.NET Core Web API + Angular project in Visual Studio using: dotnet new angular , it creates a .NET 5 project containing in the ClientApp a new Angular 8.2 project. If I F5 it, everything works perfectly. But I want to use and Angular 11 project, so i wipe the ClientApp content, open a terminal there and: ng new <app-name> --directory ./ there. Project created, F5 , the project launches but at every launch these 2 lines appear in the Debug Console: Microsoft.AspNetCore

Entity Framework Core: TPT

帅比萌擦擦* 提交于 2021-02-08 11:26:33
问题 .NET 5 preview 8 is just released and I've been testing the brand new TPT feature. I've installed the .NET 5 preview 8 Runtime and SDK. I created a .NET Core class library, installed the dotnet-ef preview 8 NuGet, updated the dotnet-ef tool with the following command (administrator): dotnet tool update --global dotnet-ef --version 5.0.0-preview.8.20407.4 I've build the following database model: public class MintPlayerContext : DbContext { // dotnet ef migrations add AddInitialEntities //

Entity Framework Core: TPT

巧了我就是萌 提交于 2021-02-08 11:26:30
问题 .NET 5 preview 8 is just released and I've been testing the brand new TPT feature. I've installed the .NET 5 preview 8 Runtime and SDK. I created a .NET Core class library, installed the dotnet-ef preview 8 NuGet, updated the dotnet-ef tool with the following command (administrator): dotnet tool update --global dotnet-ef --version 5.0.0-preview.8.20407.4 I've build the following database model: public class MintPlayerContext : DbContext { // dotnet ef migrations add AddInitialEntities //

string.IndexOf get different result in .Net 5

自作多情 提交于 2021-02-06 10:18:26
问题 When i run following code in .Net Core 3.1 i get 6 //Net Core 3.1 string s = "Hello\r\nworld!"; int idx = s.IndexOf("\n"); Console.WriteLine(idx); Result 6 but when i run this code in .Net 5 i get different result. why? //NET 5 string s = "Hello\r\nworld!"; int idx = s.IndexOf("\n"); Console.WriteLine(idx); Result -1 回答1: The comments and @Ray's answer contain the reason. And though hacking the .csproj or runtimeconfig.json file may save your day the real solution is to specify the comparison

JsonPropertyNameAttribute is not supported record from C#9? [duplicate]

耗尽温柔 提交于 2021-02-05 07:34:45
问题 This question already has an answer here : How do I target attributes for a record class? (1 answer) Closed last month . I want to use record with JsonPropertyName attribute, but it caused an error. This is not supported? Any workaround? public record QuoteResponse([JsonPropertyName("quotes")] IReadOnlyCollection<Quote>? Quotes); Error CS0592 Attribute 'JsonPropertyName' is not valid on this declaration type. It is only valid on 'property, indexer, field' declarations. 回答1: By default

Deploy ASP.NET Core 5 app to Azure App Service?

雨燕双飞 提交于 2021-02-04 13:08:22
问题 I have an existing Azure App Service running on ASP.NET Core 3.x. I have upgraded the application to today's release of ASP.NET Core 5. This works fine on my local IIS Express server. When I publish to the application to the App Service using Visual Studio, however, I receive the following error: HTTP Error 500.31 - ANCM Failed to Find Native Dependencies Common solutions to this issue: The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found. Specific error

Deploy ASP.NET Core 5 app to Azure App Service?

此生再无相见时 提交于 2021-02-04 13:07:55
问题 I have an existing Azure App Service running on ASP.NET Core 3.x. I have upgraded the application to today's release of ASP.NET Core 5. This works fine on my local IIS Express server. When I publish to the application to the App Service using Visual Studio, however, I receive the following error: HTTP Error 500.31 - ANCM Failed to Find Native Dependencies Common solutions to this issue: The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found. Specific error