-
Angular WebAPI Project using .NET Core gets ‘404 Not Found’ or runs on wrong port
My Angular / WebAPI application suddenly stopped working from Visual Studio and VSCode. Turned out that I was missing an environment variable.
-
3 Common Problems with ClaimsIdentity and ClaimsPrincipal in ASP.NET Core
In .NET Core, the ClaimsIdentity class represents a user in your application. It helps describe who they are and helps manage the list of claims which describe what they can do. But if you use the wrong constructor on ClaimsIdentity or provide the subtly wrong information to that constructor, you might see some strange behavior. …
-
ASP.NET Core Integration Tests with Selenium & WebApplicationFactory
WebApplicationFactory<T> is one of those awesome features in ASP.NET Core that practically nobody knows about. WebApplicationFactory<T> lets you quickly and easily run integration tests against your ASP.NET Core MVC or Web API application without having to deploy the app to an actual server like Kestrel or IIS. Instead of running in a “real” server, your…
-
Configure VSCode debugging to use ASP.NET Core MVC ‘watch’ auto-recompile of C# classes and cshtml views
So there’s VSCode (aka. Visual Studio Code) and there’s Visual Studio 2019. If you’re developing an ASP.NET Core MVC application using Visual Studio 2019, when you’re running the application in debug mode, if you modify one of your cshtml views, your application that’s running in the browser automatically picks up the change. Without having to…
-
WebApi Core / Swagger: “failed to load API definition” error
I was working with some ASP.NET WebApi code and needed to test something using the Swagger UI. Usually, it’s just a matter of starting the project and going to your /swagger directory. Unfortunately, in this case, I went to my swagger URL and got an error saying “Failed to load API definition — Fetch error…
-
GitHub Actions for Building, Testing, and Deploying .NET Core & ASP.NET Core Apps
Seems like there’s a lot of action(s) happening over on GitHub. How do I get a piece of that action(s)? Wheee! Puns! (I’ve been cooped up in my house too long.) So if you’re a .NET Core developer or an ASP.NET Core developer who maybe uses Entity Framework Core (EF Core), how do you deploy your apps using GitHub…
-
Some Model Properties Not Binding in ASP.NET MVC Core
[TL/DR? – skip to the bottom] I ran into a problem with an ASP.NET MVC Core app today and it took me a while to figure it out. Here’s the problem: on an extremely simple and straightforward form, I couldn’t get a field in my model to POST back to the server. Every time that…
-
“Implementing Security in ASP.NET Core: Claims, Patterns, and Policies” – Slides & Code
I spoke at the New England Microsoft Developers (NEMD) user group last night and gave a talk about security in ASP.NET Core. (A lot of this content is also covered in my new Pluralsight class on ASP.NET Core architecture.) Slides Sample code Implementing Security in ASP.NET Core: Claims, Patterns, and PoliciesThere are two sides to…
-
New Pluralsight Course: Architecting an ASP.NET Core MVC Application for Unit Testability
My latest Pluralsight course just went live a couple of days ago — Architecting an ASP.NET Core MVC Application for Unit Testability. I’ve been wanting to write this course for at least a couple of years now. I like to think of is as the missing modules from all my TFS and DevOps classes. When…
-
Slides & Code from VSLive San Diego 2018: Feature Flag Deployments with ASP.NET Core & WebAPI
I just wrapped up my “Get Good at DevOps: Feature Flag Deployments with ASP.NET & WebAPI” talk at VSLive San Diego 2018. As promised, here are the slides and the code from the talk. (If you’re wondering, yes, I’ve upgraded the code to use .NET Core 2.1.) Get Good at DevOps: Feature Flag Deployments with…