asp.net-core-3.0

DataMember Attribute is not honored in dotnet core 3.0

南笙酒味 提交于 2020-01-15 06:51:30
问题 I created a sample dotnet core 3.0 Web API project and did the following changes, Create a Model class TestData using System.Runtime.Serialization; namespace WebApplication17.Models { [DataContract] public class TestData { [DataMember(Name = "testaction")] public string Action { get; set; } } } Then I made changes in controller WeatherForecastController , to add a post endpoint [HttpPost("package/{packageName}/version/{version}")] public void Post(string packageName, string version, [FromBody

What is the alternate of HttpRequest.EnableRewind() in ASP.NET Core 3.0?

岁酱吖の 提交于 2020-01-14 07:06:08
问题 BufferingHelper.EnableRewind(); Above is an extension method for HttpRequest object in ASP.NET Core 2.2. It is no more there in ASP.NET Core 3.0 (atleast with this name). I want to know it's alternate in ASP.NET Core 3.0. I am not sure if HttpRequestRewindExtensions.EnableBuffering(); is the alternate. 回答1: The alternate is HttpRequestRewindExtensions.EnableBuffering() , indeed. You can see here that internally it just calls EnableRewind() . 来源: https://stackoverflow.com/questions/57407472

How to refresh a blazor sub/child component within a main/parent component?

不打扰是莪最后的温柔 提交于 2020-01-11 12:43:33
问题 You have a main component and inside the main component you have many sub-components You want to refresh a single subcomponent, rather than the entire screen of the main component, is this possible? 来源: https://stackoverflow.com/questions/59226890/how-to-refresh-a-blazor-sub-child-component-within-a-main-parent-component

SignIn for Blazor Server-Side app not working

99封情书 提交于 2020-01-11 10:17:11
问题 I am building a sample login razor component for an Asp.net core 3.0 Blazor Server-Side app. Whenever the code reaches the SignInAsyc method it just appears to hang or lock-up, as the code ceases further execution. I also tried switching up the logic, by using the PasswordSignInAsync method which gave me the exact same result. All code would execute before that method, but then freeze upon execution of that statement. What am I missing here? Razor component page: <div class="text-center">

Azure functions stopped working after Core 3.0 update

≡放荡痞女 提交于 2020-01-11 07:30:08
问题 The code is working in Core 3.0 preview7 version, but after updating to 3.0 Azure functions started giving an error. The error comes if I try to access builder service object. Also not able to debug the issue. Also tried updating Microsoft.Extensions.DependencyInjection 3.0 but still the same error. public class Startup : FunctionsStartup { public override void Configure(IFunctionsHostBuilder builder) { var descriptor = builder.Services.FirstOrDefault(d => d.ServiceType == typeof

onclick method not working in Blazor server-side razor component

走远了吗. 提交于 2020-01-11 07:04:43
问题 I am building a sample razor component, and I can not get my button onclick method to fire. When I click the button nothing happens at all. I have even placed a break point in the method to see if it catches which it doesn't. The component does render, but as I said the LoginUser method doesn't appear run at all when clicking the button. razor componet page: <div class="text-center"> <Login FieldsetAttr="fieldsetAttr" UsernameAttr="usernameAttr" PasswordAttr="passwordInput" ButtonAttr=

Cannot access a disposed object in Blazor Server 3.0

丶灬走出姿态 提交于 2020-01-07 08:24:33
问题 I got a Blazor page with following form submit button <button type="submit" class="btn btn-primary" @onclick="@(async()=> await OnCreateItem())">Create </button> Which calls protected async Task OnCreateItem() { try { var result = await dbMgr.CreateAsync(item); } catch (Exception ex) { Throws ==> Cannot access a disposed object. A common cause of this error is disposing a context that was resolved from dependency injection and then later trying to use the same context instance elsewhere in

AspNetCore 3.0 - HTTP Error 500.0 - ANCM In-Process Handler Load Failure

十年热恋 提交于 2020-01-06 05:21:09
问题 I created two ASP.NET Core web applications - just API templates: ASP.NET Core 2.2 ASP.NET Core 3.0 Deployed these applications to the Windows Server 2016 with latest (3.0 Runtime & Hosting Bundle). ASP.NET Core 2.2 works correctly without any problems, but ASP.NET Core 3.0 gives me this error from image below. In event viewer I found error every time when I deploy or try to start 3.0 application: Application 'C:\Inetpub\vhosts\webapp.com\httpdocs\' failed to start. Exception message:

When publish self-contained, how to place/load framework dll's in a subfolder

眉间皱痕 提交于 2020-01-06 05:21:07
问题 After published, my file/folder structure looks like this - Connected Services - SomeService - file1 - file2 - Pages - PartialFiles - file1 - file2 - refs - files - wwwroot - css - file1 - file2 - api-ms-win-core-... - api-ms-win-core-... - api-ms-win-core-... - api-ms-win-core-... - ... - MyCoreApp... - MyCoreApp... - MyCoreApp... - MyCoreApp... - ... - Microsoft.AspNetCore... - Microsoft.AspNetCore... - Microsoft.AspNetCore... - Microsoft.AspNetCore... - Microsoft.AspNetCore... - ... Is

How to configure routing in ASP.NET CORE 3.0 to use overload [HttpGet] method with [FromQuery] parameters?

China☆狼群 提交于 2020-01-05 08:26:25
问题 Sorry about the title, I'm not good at them, let me know if you know any better title to describe the content of the question. So I have 2 methods, the first one is to get all the list items, and the second is to get all the list items too, however, there is a query parameter on the second method, that I use to filter, and the second method also returns a different object than the first method. Since I have 2 Http get methods that go to the same route, when I call one of the methods I get: