asp.net-core-3.1

Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Cannot assign requested address'

这一生的挚爱 提交于 2020-07-21 07:58:10
问题 I am using asp.net core 3.1 docker enabled project template (VS2019) to develop a web API. There are no compilation errors. While running the project, in the output window of the VS2019 I see the following message: Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Cannot assign requested address'. Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/3.1.0/System.Collections.NonGeneric.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My

Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Cannot assign requested address'

我的梦境 提交于 2020-07-21 07:58:06
问题 I am using asp.net core 3.1 docker enabled project template (VS2019) to develop a web API. There are no compilation errors. While running the project, in the output window of the VS2019 I see the following message: Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Cannot assign requested address'. Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/3.1.0/System.Collections.NonGeneric.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My

Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Cannot assign requested address'

坚强是说给别人听的谎言 提交于 2020-07-21 07:57:58
问题 I am using asp.net core 3.1 docker enabled project template (VS2019) to develop a web API. There are no compilation errors. While running the project, in the output window of the VS2019 I see the following message: Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Cannot assign requested address'. Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/3.1.0/System.Collections.NonGeneric.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My

Project build failed while using .net class library in .net core console application

别来无恙 提交于 2020-07-16 09:40:44
问题 I have .Net Core 3.1 console application which is referring to a class library project FxCore which is added as a reference. class library csproj has <TargetFrameworks>net45;net451;net452;net46;net461;net462;net47;net471;net472</TargetFrameworks> I have tried changing it to <TargetFrameworks>net45;</TargetFrameworks> , but still getting the same error. I am getting the below error., I have tried clean -> ReBuild, Reopen the visual studio 2019 (version 16.5.2) 1>------ Build started: Project:

Redirecting ASP.NET Core 3.1 MVC Web App not working

点点圈 提交于 2020-07-10 10:26:31
问题 I've published a brand new out-of-the-box app in Azure App Service using a F1 (free) App Service Plan. I have the following class to redirect incoming request like www.mywebapp.azurewebsites.net/ to https://mywebapp.azurewebsites.net/ : public class NonWwwRule : IRule { public void ApplyRule(RewriteContext context) { var req = context.HttpContext.Request; var currentHost = req.Host; if (currentHost.Host.StartsWith("www.")) { var newHost = new HostString(currentHost.Host.Substring(4),

“415 Unsupported Media Type” for Content-Type “application/csp-report” in ASP.NET Core

↘锁芯ラ 提交于 2020-07-08 09:27:29
问题 I have a content security policy that causes Chrome to post a report, but the action that receives the report returns "415 Unsupported Media Type". I understand this is because the post has a Content-Type of "application/csp-report". How do I add this as a allowed content type in Core 3.1 (its basically just json). Action // https://anthonychu.ca/post/aspnet-core-csp/ [HttpPost][Consumes("application/csp-report")] public IActionResult Report([FromBody] CspReportRequest request) { return Ok();

“415 Unsupported Media Type” for Content-Type “application/csp-report” in ASP.NET Core

Deadly 提交于 2020-07-08 09:25:47
问题 I have a content security policy that causes Chrome to post a report, but the action that receives the report returns "415 Unsupported Media Type". I understand this is because the post has a Content-Type of "application/csp-report". How do I add this as a allowed content type in Core 3.1 (its basically just json). Action // https://anthonychu.ca/post/aspnet-core-csp/ [HttpPost][Consumes("application/csp-report")] public IActionResult Report([FromBody] CspReportRequest request) { return Ok();

Blazor WebAssembly 3.1 Target Framework is missing

旧城冷巷雨未停 提交于 2020-06-28 07:19:27
问题 I created a .NET Core Web API and class library with .NET Standard 3.1. But when I try to create Blazor WebAssembly with 3.1, it automatically creates a 2.1 version - as seen here: This is my Blazor web and .NET Core 3.1 is not listed. I install the 3.1 version again but still not listing. I already have .NET Core 3.1 version on Web API and class library but I don't understand why I can not create Blazor 3.1. But when can I create blazor server side application as 3.1 but I can't create web

EF Core lazy loading proxies return null randomly instead of entities

被刻印的时光 ゝ 提交于 2020-06-26 16:23:26
问题 I have a .Net Core 3.1 application with an SQL database. I use lazy-loading proxies to automatically retrieve data from related tables. Basically, I have a table, which references some other entities via 1-to-many or 1-to-1 relation. Thing is, most of the cases, every relation is OK, every entity is loaded and I can read it's properties (name field, for example). But, in very specific cases, those entities won't load , although relation Id is there. It looks like this: Model is like this:

How to resolve dependency in dependency register time in Autofac

落花浮王杯 提交于 2020-06-23 05:37:50
问题 earlier I used Microsoft unity IOC. Unity container has RegisterType & Resolve method. So I able to resolve same interface with multiple implementation. but latest autofac (var builder = new ContainerBuilder();) builder hasn't resolve() method and we can't manually build (builder.Build();). Anyone has any idea, how to convert below code base to autofac or how to use resolve method with dependency registration. container.RegisterType<IQueryManager, FirstManager>(new TypedParameter(typeof