Shawn Wildermuth

The Blog

My Rants and Raves about technology, programming, everything else...


Updating My Blog to Visual Studio 2017 and .csproj

cat-667909Now that the ASP.NET Core tooling changes are finally here, I decided to update my blog to the new bits. Goodbye project.json and hello .csproj.

Finding the project after upgrading it, I had to look for those points of contact I had gotten comfortable using. The upgrade wasn’t painful (look back at those Beta 7-Beta 8 upgrades for that story), but knowing where they moved your cheese is important. Hopefully this post helps you with the same issues.

I’ve been watching the changes from using the project.json file to MSBuild (e.g. .csproj) for a while. Instead of manually updating it (which you can do with the SDK alone), I decided to just open the project in Visual Studio 2017 and let it update it for me. What I ended up with was a backup directory with my old project.json file and a couple of new files:

Read...


New Course on Building an API with ASP.NET Core

codesoupAre you new to ASP.NET Core? Maybe you’re building an API for your SPA, mobile app, or just your web app. I recently released a new Pluralsight course that can help you.

This new, six-hour, course covers the basics of building REST APIs with ASP.NET Core. Whether you’re just exposing your data via REST, or building microservices, this new course should have you covered.

Here is a preview of what the course contains:

Read...


Speeding up Azure App Service Builds

 3142010593_ac06de5f0c_oI run this blog and other sites on Azure App Services (used to be called Websites). As you might know all that code is open source on GitHub and I use that code to deploy directly to Azure.

I use the GitHub deployment that Azure offers so that every time I push a change to my master branch, it creates a new deployment for me. It's been pretty great, except...the deployment is pretty slow. Normally the speed of this deployment wouldn't matter a lot, except of course when I push a bug out to 'live'. Then the speed really matters.

I was perusing the builds and noticed that a build was taking 1014 seconds. That's an ASP.NET project with very little client-side building (e.g. no webpack or similar). Getting the source, doing the restore, building the project, and deploying it all shouldn't be taking 16+ minutes.

Read...


Updating WilderBlog to ASPNETCore 1.1

yawning_babyI upgraded my WilderBlog project to ASP.NET Core 1.1 today. I had planned on writing a big blog post about how to accomplish it, but I was surprised instead by how uneventful the process was.

Some of my students were using ASP.NET Core 1.1 in their walk through using my Pluralsight course and I was unsure of how much of a problem that was going to be, but so far no problems really.

So to upgrade my WilderBlog project, I did two uneventful things:

Read...


My First ScriptCS

I’ve known Glenn Block for a long time now and I’ve heard about the ScriptCS project he’s worked on for a long time. I’ve never had time to dig in until now.

For the uninitiated, ScriptCS is a scriptable environment that uses .NET and C# for it’s platform. It makes writing simple scripts easier if you know C# already. It has support in several different editors, but I’ll talk about how I used it with Visual Studio Code since that’s my new favorite toy.

Before I can learn something interesting I have to have a job to do. In this case I had a simple problem: I needed to clean up Visual Studio projects. I create a *lot* of projects. Whether they are examples for courses, talks, or for my own investigations, I end up with projects lying around everywhere. Before I could share them, I want to clean them of temporary data (e.g. bin and obj directories, et al). Now that I use GitHub for many of these projects, cleaning isn’t that important but even in that case I still have a lot of disk space devoted to these files, so I still want to clean them up.

Read...


Looking for the Goldilocks of Web Frameworks

So I’ve been on a mission of sorts…I’m looking for the right size framework for some of my web development. I know what you’re saying, “Aren’t you suggesting Angular2 for everything”? No, no I’m not.

I just made a bunch of you excited. You React, Aurelia, and Ember enthusiasts and now probably foaming at the lips ready to tell me to use one of your frameworks! Hold off for now. Let’s talk about it.

The problem for me is fairly simple, I don’t want to build a Single Page Application (e.g. SPA). Yeah, I know.

Read...


Boston Code Camp 2016

downloadI had the good fortune of being picked to speak at the Boston Code Camp for their winter event. As some of you know I used to live in Boston and it was a fun few days of reminicence.

The talk that got picked was ASP.NET Core Logging. As I've discussed on this blog, I'm a fan of how the logging is implemented.

Thanks for coming to my talk if you were able to come. The talk wasn't recorded, but I'm happy to share the code and the slides:

Read...


Testing SSL in ASP.NET Core

deadboltWhen building my ASP.NET Core apps, I usually enable the RequireSSL filter in production environments. But I’ve never went through getting it to work on my dev box as I thought it was harder than it actually was.

Effectively to get SSL running, I thought I needed to get involved in creating and handling certificates. Not really true.

If you’re developing in Visual Studio 2015 and running on Windows, enabling SSL is really easy.  Just open your project settings and look on the Debug tab. You’ll see a checkbox to enable SSL in IIS Express (make sure you have “IIS Express” selected in “Profile”

Read...


What I Learned Building with ASP.NET Core: Part 1 - Routing

Spaghetti-Junction-CropI’ve been digging into ASP.NET Core for quite a while now (from the early betas through the current release). Recently I re-wrote the Atlanta Code Camp website using ASP.NET Core.

Through that process I’ve learned some new lessons about ASP.NET Core and this series of blog posts is going to talk about those lessons. I have no idea how many parts it will have, but I’ll post all that I’ve learned in building a site with real users ; )

Originally, the old Atlanta Code Camp utilized MVC Areas to handle the different years that we held the code camp. I wanted to keep that functionality (and even move prior years to the new site) but I wanted to avoid Areas. I like areas for real site areas, but it felt like a hack to use it for separate years. In addition, the Areas forced me to copy/paste each year and modify them every year.

Read...


ASP.NET Core Dependency Injection

codesoupI’ve been building some ASP.NET Core apps as of late and had to dig into how Dependency Injection works there. After talking with Julie Lerman a bit on Twitter about it, I realized that there might be some confusing things about how it works in ASP.NET Core, so I’m hoping I can add some clarity in this post.

One thing I like about ASP.NET Core is that since it is a new platform, I’m learning something new all the time. When I suggested to Julie to use DI in her example database seeder, but of course there were things I was missing and my suggestion would actually just leak a context object. Lets look at some of the default dependency injection in ASP.NET Core to see how it is supposed to work.

First question is whether the built-in dependency injection should be used at all. Lots of developers and companies have had long-winded meetings and discussions how a specific DI layer is marginally better than all the rest. Some third-party DI layers have additional features that you really want, so it’s up to you. Most of the major players (e.g. StructureMap, Ninject, etc.) have integration with ASP.NET Core’s DI so you can switch out the built-in provider. I find the built-in provider to be fast, but not exactly feature rich but for smaller projects it’s easy and simple so that’s what I’ll talk about.

Read...