Migrating to .NET Core 3 | ASP.NET Core 2.2 & 3 REST API Tutorial 16

  Рет қаралды 23,346

Nick Chapsas

Nick Chapsas

Күн бұрын

Пікірлер: 36
@NomadicBrian
@NomadicBrian 3 жыл бұрын
Well done. I like the way you present the material. Quite helpful in gathering my notes for an upcoming 2.2 to 3.1 conversion project. The integration test notes were very interesting. Thanks
@rodmcbride9165
@rodmcbride9165 5 жыл бұрын
Great series Nick and it awesome to see you included the bits about JWT, Integration Testing and Migrating to .NET Core 3.0. Keep up the great work and keep coding!
5 жыл бұрын
Absolutely amazing videos. Please continue in this deep netcore v3 knowledge transfer
@AntoNosu
@AntoNosu 4 жыл бұрын
The AddEntityFrameWorkStores Method on the IdentityBuilder does not exist for me, do you know how to fix that? or what it's been replaced with. I cant find anything online EDIT: I found it in the package "Microsoft.Extensions.Identity.Core" For anyone with the same issue :)
@michaelm5278
@michaelm5278 5 жыл бұрын
Hej Nick. First of all, great series! When running the tests i get an "UnsupportedMediaTypeException" with the description: No MediaTypeFormatter is available to read an object of type 'AuthSuccessResponse' from content with media type 'text/plain' It complains about the method called AuthenticateAsync and more specifically this line: var registrationResponse = await response.Content.ReadAsAsync(); Any suggestions how to fix this? I have tried downloading your project from github, but i get the same error.
@ketelsb
@ketelsb 5 жыл бұрын
Hello Michael. I had the same issue. Have you checked that you updated all your nuget assemblies to the latest preview version? Check my post above about the nightly builds to get the latest ones. If you don't see the preview builds in Visual Studio, go to Tools->Options, General -> Preview Features and check the "Use previews of the .NET Core SDK" checkbox. This checkbox has been moved to this location recently. When you open the NuGet UI, make sure you also check the checkbox "Include prerelease". Update the assemblies in the Tweetbook project and also in the IntegrationTests project.
@silverciri1379
@silverciri1379 5 жыл бұрын
have tested with preview 9, still doesn't fix the "UnsupportedMediaTypeException" problem.
@michaelm5278
@michaelm5278 5 жыл бұрын
@@ketelsb Hi, ive tried what you suggested, but i still get the same error. Sure you didnt do anything else to fix this issue?
@michaelm5278
@michaelm5278 5 жыл бұрын
@@ketelsb Wait a minute, the method AuthenticateAsync works now, but instead i get the same error when calling the method CreatePostAsync (defined in the base test class as in the video).
@ketelsb
@ketelsb 5 жыл бұрын
@@michaelm5278 I know I had that same issue, but I don't exactly know how I fixed it... Maybe it helps to provide you with the nuget packages/versions I used? I will try to recreate the situation. Maybe I will remember how I fixed it... FluentAssertions 5.9.0 Microsoft.AspNet.WebApi.Client 5.2.7 Microsoft.AspNetCore.Mvc.Testing 3.0.0-preview9.19424.4 Microsoft.EntityFrameworkCore.InMemory 3.0.0-preview9.19423.6 Microsoft.NET.Test.Sdk 16.3.0-preview-20190828-03 xunit 2.4.1 xunit.runner.visualstudio 2.4.1
@ishaqsalamdwicahyo1701
@ishaqsalamdwicahyo1701 4 жыл бұрын
Great tutorial, but i getting error in PostsControllerTests file at every word "Should", for excample "response.StatusCode.Should().Be(HttpStatusCode.OK);" and description of error is 'HttpStatusCode' does not contain a definition for 'Should' and no accessible extension method 'Should' accepting a first argument of type 'HttpStatusCode' could be found (are you missing a using directive or an assembly reference?) what should i do?
@mihaimyh
@mihaimyh 5 жыл бұрын
Thank you for your efforts on creating these videos. Is there a way to handle authorization in dotnet core 3? Can you create a video for this? I know there is role and policies based authorizations but I don't know exactly how to integrated them withing API?
@nickchapsas
@nickchapsas 5 жыл бұрын
I already have a video on this in my series, you can find that here: kzbin.info/www/bejne/g2eknJV4lql6gKc . Even though it said 2.2 the code should be identical in 3.
@ksutine
@ksutine 5 жыл бұрын
Great video, very helpful. With dotnet Core 3.0 officially out, and dependency to NewtonsoftJson removed, what changes should be done to Swagger Examples? The latest Swashbuckle.AspNetCore.Filters still has NewtonsoftJson dependency, and for me the Examples don't show in CamelCase anymore, even though the scheme has them right, and the response comes correctly.
@loveandladles
@loveandladles 5 жыл бұрын
I am getting error Could not load type "Microsoft.AspNetCore.MvcJsonOptions" from assembly "Microdoft.AspNetCore.Mvc.Formatters.Json" when migrating from 2.1 to 3.0. Could you please help ?
@haozhang6247
@haozhang6247 5 жыл бұрын
Man you are soooo goooooood!!
@CarlosHerreraJugovie
@CarlosHerreraJugovie 5 жыл бұрын
Hello, Excellent video, one question: how do you do to have that theme in the visual studio IDE? thanks
@nickchapsas
@nickchapsas 5 жыл бұрын
This isn't a theme. This is a different IDE called Jetbrains Rider.
@CarlosHerreraJugovie
@CarlosHerreraJugovie 4 жыл бұрын
@@nickchapsas Thanks dude..!!!
@ketelsb
@ketelsb 5 жыл бұрын
When upgrading to core 3 preview 8, I had issues when the Integration tests gave nullreference exceptions on the FindByEmailAsync method of the UserManager when it was used in the InMemory mode. After some research I came to this article, explaining that the issue was present in preview 6 and was still not fixed in preview 8. However, it is fixed in preview 9 nightly builds. github.com/aspnet/EntityFrameworkCore/issues/16099 Here is information on how to configure nuget to use the nightly builds: github.com/aspnet/AspNetCore/blob/master/docs/DailyBuilds.md Enjoy!
@nickchapsas
@nickchapsas 5 жыл бұрын
Hey Bravo, I explicitly said that in the video. The issue you linked was the very reason. Thanks for the detailed comment.
@qnill12
@qnill12 5 жыл бұрын
Hi Nick, Thanks for videos. I upgraded my project from version 2.2 to version 3.0. I keep the installer files like you in separate classes. But when I write the code "options.EnableEndpointRouting = false" to the "MVCInstaller" class, "app.UseMvc ()" in startup.cs code is running, but the warning continues to appear. But when I write the code into "startup.cs" instead of the "MVCInstaller" class warning I'm not getting an error. I wonder why ?
@ian2neko
@ian2neko 5 жыл бұрын
Tested still works in 3.1 BUT as of today (2020-01-16) with 3.1.1 updates, suddenly there is a runtime error "Could not load file or assembly 'Microsoft.AspNetCore.Razor.Runtime, Version=3.1.1.0". And Razor.Runtime v3.1.1 doesn't even exist.
@maghameghomaghamegho8615
@maghameghomaghamegho8615 5 жыл бұрын
Im getting the following error message TypeError: Failed to execute 'fetch' on 'Window' once I add [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] on the Post controller .. so what is it mean and how can I solve it? Thank u in advance :)
@patrikfajnar6568
@patrikfajnar6568 5 жыл бұрын
I just realized after I migrated the project I couldn't connect to my api from other device in the network. If i migrate it back it works again. What is causing this problem? Can you help me?
@nickchapsas
@nickchapsas 5 жыл бұрын
Did you do the AddMvc change for the routing?
@patrikfajnar6568
@patrikfajnar6568 5 жыл бұрын
@@nickchapsas Yes, I did. Neither yours nor mine worked for me. I added my ip address to the app urls and my firewall doesn't block my chosen port. It works on ASP.NET 2.2. I replaced WebHostBuilder to HostBuilder too as this say: docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-2.2&tabs=visual-studio#hostbuilder-replaces-webhostbuilder
@nickchapsas
@nickchapsas 5 жыл бұрын
@@patrikfajnar6568 Can you download the repo from the description and see if that works?
@patrikfajnar6568
@patrikfajnar6568 5 жыл бұрын
@@nickchapsas I've just tried your version it doesn't work for me. My other device say: connection timed out.
@patrikfajnar6568
@patrikfajnar6568 5 жыл бұрын
Is this work for anyone?
@lovethynatures
@lovethynatures 5 жыл бұрын
i cpuld not see the video clearly
@nickchapsas
@nickchapsas 5 жыл бұрын
Did you try increasing the quality to 1080p and setting it on full-screen?
Response caching using Redis | ASP.NET Core 5 REST API Tutorial 25
23:34
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
Introduction to .NET Microservices (.NET 8)
7:56:55
DotNetMastery
Рет қаралды 202 М.
Worker Services in .NET Core 3.0 - The New Way to Create Services
47:09
Why is Microsoft Harming .NET Open-Source?
9:37
Nick Chapsas
Рет қаралды 30 М.
The Right Way To Return API Errors in .NET
10:40
Nick Chapsas
Рет қаралды 65 М.
Introduction to ASP.NET Core MVC (.NET 8)
9:26:04
DotNetMastery
Рет қаралды 739 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 220 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН