-
Fix: ASP.NET Core <select> control is empty
I found a nifty little quirk in ASP.NET Core recently where the <select> control (dropdown, combobox, listbox) is empty. Basically, put a <select> control in your ASP.NET cshtml view, bind that control to a Model class with data, and then what shows up in the browser is an empty control. It turns out that it’s…
-
VSLive Anaheim 2017: ASP.NET & ASP.NET Core Security
I spoke at VSLive Anaheim 2017 this week. As promised, here are my slides and code from the ASP.NET & ASP.NET Core Security talk. Role-Based Security Stinks: How to Implement Better Authorization in ASP.NET & WebAPI In .NET, if your user permissions are simple, you’re in luck. Access the IPrincipal for the current user, call…
-
“DevOps with ASP.NET Core, EF Core, & TFS2017”: Slides & Code
[Updated 3/23/2017 — If you saw this talk at DevBoston or Code Camp Boston, it’s the same slides and code at NYC .NET.] I spoke at the NYC .NET Developers user group last night and gave my new “DevOps with ASP.NET Core, EF Core, & TFS2017” talk. DevOps is all about software delivery. Create an…
-
Deploy Entity Framework Core Migrations from a DLL
[Updated 4/27/2018 — Added an EF Core 2 version of this script in a new blog post.] [Updated 3/29/2017 — Added a bash version of this script for deploying EF Core Migrations from Linux.] Entity Framework Migrations let you deploy incremental updates to a target database. With Entity Framework Core (EF Core) this is done from…
-
TFS Build / Release Configuration Utilities: Edit app.config, web.config, appsettings.json, and XML
When you’re working automated builds and automated releases, you frequently need to edit configuration files like app.config, web.config, and appsettings.json. Well, I wrote a command line utility to do this and I figured I’d share. I’ve got a version that is an .exe that can be used on a Windows build agent and I’ve got a version that’s written…
-
EF Core Migrations without Hard-coding a Connection String using IDbContextFactory
[12/19/2017 — This has changed in EF Core 2.0. Here’s the updated details.] In my last post, I showed you how to set up an ASP.NET Core and Entity Framework Core solution so that you can use EF Core Migrations for database updates. That code sample used a hard-coded database connection string in the OnConfiguring()…
-
Walkthrough: Entity Framework Core 1.1 with Migrations
Here’s a walk-through on how to create a new solution that uses an ASP.NET Core project, an MSTest unit test project, and Entity Framework Core 1.1 (EFCore1.1). I’m not sure if you’ve found this to be the case but I’ve been struggling with the documentation for a few days trying to figure out how to…
-
Script: Create new ASP.NET Core Project with Class Library & Tests
Building on my post about how to do some common Solution and Project tasks using the dotnet command, here’s a sample script to create a complete solution that can be used from Visual Studio 2017 or Visual Studio Code. I wanted to be able to create a complete solution and project structure all from the…
-
Cheat Sheet: Use dotnet.exe to Create New Solutions, Projects, & References
I’ve been playing with .NET Core a lot lately and I’ve been trying to stick to the command line and Visual Studio Code as much as possible so that I can really learn what’s going on so I can (eventually) do cross-platform devops-y things. This means that I’m spending a lot of time with dotnet.exe…which…
-
VSLive Austin 2016: ASP.NET MVC / Core Security Slides & Code
I spoke at VSLive Austin 2016 last week. As promised, here are the slides & code samples from my ASP.NET MVC / ASP.NET Core Security Authorization Talk. Role-Based Security Stinks: How to Implement Better Authorization in ASP.NET & WebAPI In .NET, if your user permissions are simple, you’re in luck. Access the IPrincipal for the…