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

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024

ความคิดเห็น • 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 4 ปีที่แล้ว

    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 ปีที่แล้ว +1

    Absolutely amazing videos. Please continue in this deep netcore v3 knowledge transfer

  • @mihaimyh
    @mihaimyh 5 ปีที่แล้ว +1

    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: th-cam.com/video/M6AkbBaDGJE/w-d-xo.html . Even though it said 2.2 the code should be identical in 3.

  • @ketelsb
    @ketelsb 5 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      Hey Bravo, I explicitly said that in the video. The issue you linked was the very reason. Thanks for the detailed comment.

  • @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 :)

  • @ksutine
    @ksutine 4 ปีที่แล้ว

    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.

  • @ishaqsalamdwicahyo1701
    @ishaqsalamdwicahyo1701 3 ปีที่แล้ว

    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?

  • @haozhang6247
    @haozhang6247 4 ปีที่แล้ว

    Man you are soooo goooooood!!

  • @michaelm5278
    @michaelm5278 5 ปีที่แล้ว +2

    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 ปีที่แล้ว +1

      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

  • @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 ?

  • @shrutisikchi2211
    @shrutisikchi2211 4 ปีที่แล้ว

    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 ?

  • @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 :)

  • @ian2neko
    @ian2neko 4 ปีที่แล้ว

    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.

  • @CarlosHerreraJugovie
    @CarlosHerreraJugovie 4 ปีที่แล้ว

    Hello, Excellent video, one question: how do you do to have that theme in the visual studio IDE? thanks

    • @nickchapsas
      @nickchapsas  4 ปีที่แล้ว +2

      This isn't a theme. This is a different IDE called Jetbrains Rider.

    • @CarlosHerreraJugovie
      @CarlosHerreraJugovie 4 ปีที่แล้ว

      @@nickchapsas Thanks dude..!!!

  • @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 4 ปีที่แล้ว

    i cpuld not see the video clearly

    • @nickchapsas
      @nickchapsas  4 ปีที่แล้ว

      Did you try increasing the quality to 1080p and setting it on full-screen?