Shawn

Shawn Wildermuth

Stories

Tagged with ASP.NET Core


Two AuthorizationSchemes in ASP.NET Core 2

Safe Cracking Balaclava Clad BurglarWhen ASP.NET Core 2 shipped the early previews, I knew one large change was going to be the Identity subsystem. The Identity for ASP.NET Core 1 worked ok, but the setup was very confusing with identical configuration is more than one place.

I’m happy to say that in ASP.NET Core 2 it’s much better. Implementing JWT Tokens for APIs was more confusing than I liked back when I wrote my Implementing an API in ASP.NET Core course for Pluralsight. I was hoping that it changed to simplify the way it works.

Now that I’m re-writing my ASP.NET Core End-to-End course for Pluralsight, I wanted to be able to both Cookies and JWT without having to split the projects. While this should work in ASP.NET Core 1, I couldn’t figure it out.

Read...


ASP.NET Core 2.0 Released

Image result for webI’m very excited that the v2 of ASP.NET Core is now released. Married with Visual Studio 2017 Update 3 (or VS Core), it is now a maturing platform.

I really like what the team has been doing since the release of 1.0. They seem to really have thought about the pain points of the initial versions and worked to eliminate as many as they could.

Of course v1.x was a bumpy time. The migration from project.json to MSBuild was a painful one, but we’re past that now. You can get it now from the dot.net website:

Read...


Scenic City Summit 2017

speakingJust got back from Chattanooga, TN for Scenic City Summit. I got to do two talks there and had some great audiences and questions.

Was great to catch up with some of the best speakers in the southeast at the event. I hope the attendees enjoyed it as much as I did.

As promised, here are the slides and the code from my two talks:

Read...


My Talk at Birmingham .NET User Meetup

bg-birminghamI had the opportunity to present ASP.NET Core 2.0 to a great group in Birmingham, AL tonight. The attendees were almost as good as the BBQ!

Doing a talk on a preview (ASP.NET Core 2.0) on top of another preview (VS 2017 Preview) is always risky, but it went well. Lots of great questions and hopefully I convinced some of the attendees to give it a try.

As promised, I wanted to share the slides and code:

Read...


ASP.NET Core 2 + VS2017 + Angular-CLI?

I’m working on an update for my ASP.NET Core course for version 2.0. One major change is to use Angular (v4 probably) in the new course.

My challenge was to get Angular and ASP.NET Core to work together. I like the idea about Angular-CLI doing all the boilerplate since setup is a bit of a headache. Should be an easy win-win. Well…

UPDATE: Forgot about turning TypeScript off in the project. See Below.

Read...


Program.cs in ASP.NET Core 2.0

Elevated_Building_FoundationI am sure that many people like me are digging into ASP.NET Core 2.0 and curious about what has been changed. I’m going to start with the very start of your ASP.NET Core project, the program.cs.

Digging into the meat of ASP.NET Core 2.0 might lead you to identity, the better .NET Core support, and other changes. But I think the startup is where you can start to see the platform mature.

So in ASP.NET Core 1.x, the usual program.cs usually looked like this:

Read...


Using VS Code and ASP.NET Core?

Image result for vs code logoDevelopers are an odd beast. Some developers love a big IDE and lots of automation to help them create great solutions.

The other type of developer, wants to write code quickly and spends a lot of time at the command-line. Luckily, Microsoft supports both types of developer.

Even though I use Visual Studio quite a lot, the brevity of Code allows me to be faster sometimes. Because of this I created a course showing how to use VS Code with ASP.NET Core projects.

Read...


Techorama 2017

tvrobot4xI had the pleasure of being invited to Techorama in Antwerp, Belgium this year. As usual, Gil and the team had a great event with over 1,500 attendees.

I love this conference because the attendees are so plugged in and I get great questions every time I do a talk there. I want to thank everyone for coming to see me talk on ASP.NET Core even though I had lost my voice. We muscled through though and hopefully some people are digging in deeper with it now.

34822474391_7d81d2f650_o

Read...


Wroc# Wrap-Up

P1000610The great organizers of Wrocsharp invited us to come to Poland and present at an unusual conference. I had a great time and everyone was just lovely to me and my wife!

Wroclaw Poland (not pronounced anything like you’re thinking) is a lovely little city that has an interesting history. We enjoyed chasing down some of the hundred or so dwarves that line the front of shops and churches (seen to the right – yes, that’s a dwarf using a tiny ATM).

Wroc# is an interesting event in that they bring in a large number of people (I’m guessing 400 or so) and they have one huge track. Six speakers plus a Q & A Panel for the six speakers and that’s it. I felt very privileged to be picked to be one of the speakers (which included great speakers like Tess Ferrandez, Steven Sanderson, Chris KlugMaarten Balliauw, and Frans Rosén). It was a great day of .NET and C# content:

Read...


ASP.NET Core Snippets for Visual Studio Code

Image result for visual studio code logoI’m currently creating a new course on how to use Visual Studio Code with ASP.NET Core. While I rely on yeoman for project scaffolding and some file scaffolding, I wanted to get some of the snippets I’ve grown used to having in the full Visual Studio.

I found a project called ASP.NET Core Snippets to my excitement, but it only had snippets for some of the main files in your project. Not action snippets or razor snippets. So at 4am last night I wrote a Visual Studio Code extension to add some of these snippets.

So far, it only has a handful of snippets that my 4am brain knew I wanted:

Read...


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...


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...


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...


NDC Sydney was Awesome!

20160805_172651We just left Sydney after a great few days of the NDC Sydney conference. Saw some very cool talks about ASP.NET Core and Angular2!

Of particular interest was a talk by Steven Sanderson on JavaScript services for ASP.NET Core (e.g. cool things to do with Angular2, React and Node). When the recording is done, you should totally go see it!

I had two talks at the event: “ASP.NET Core Logging” and “Getting Ready for Bootstrap 4”. When the videos are posted, I’ll share them here. But for the people who attended the talk, you can get my demos here in github:

Read...


My ASP.NET Core Course Has Been Updated to RTM

I’m really excited to announce that my popular Pluralsight course on ASP.NET Core has been updated to RTM. It’s been a long slog to update and I apologize for the delay but it’s ready now.

The course is so different from the earlier builds, that we’ve decided to retire the older course and create a complete fresh course. Over 60% of the videos had to be updated and the entire set of example code had to be changed too.

Luckily we’ve reached the RTM milestone so that we can finally depend on the APIs not being changed. The ASP.NET Core tooling is only at Preview 2 so we will be making minor changes to the course as the tooling is updated.

Read...


Converting ASP.NET Core 1.0 RC2 to RTM Bits

officetoolsIf you’re like me, you’ve changed your projects from RC1 to RC2 only to find out that the RTM was coming quickly. Well we are here so we need some steps to convert projects.

Like other posts, I am going to list all the changes I found but there are likely more that I didn’t run into. Feel free to use the comment system to add more as you like!

Rename all the “1.0.0-rc2-final” references to just “1.0.0

Read...


ASP.NET Core 1.0 Released!

DiscussThis day has been a long time coming but I want to congratulate the team at Microsoft for delivering the first version of ASP.NET Core! I’m very excited to start working with the bits on real projects.

If you haven’t had a chance to look at play with ASP.NET Core, it’s time! For the ASP.NET MVC and Web API users, the transition is pretty quick, but if you’re coming from ASP.NET Web Forms or another technology, there is a learning curve.

My sense of it is that this is a new platform, not a new development model. You are closer to the metal without having to give up the productivity of the ASP.NET you’ve always loved (and maybe hated a little). This is a mature, open source, cross platform, and fast ASP.NET. It’s a new day in Microsoft’s web platform and it’s time to be a part of it.

Read...


Thanks for the Great Road Trip!

We’re home. It’s a fantastic feeling, but we had a great time. I wanted to take some time to thank all the great attendees, guests and helpers that made this a great trip. We got some great podcasts and hopefully encouraged a lot of people to try out ASP.NET Core!

We took a lot of pictures and you can see some of them by clicking on the mosaic to the right!

Some statistics of the trip:

Read...


Converting an ASP.NET Core RC1 Project to RC2

datascreenWith the release of ASP.NET Core RC2, Microsoft hit a major milestone. But this change isn’t a trivial one. It’s a big change.

Since I’m updating my Pluralsight course on ASP.NET Core, I wanted to get a list of changes for the new version. I figured I’d share all the changes I could find converting a stock RC1 project to a RC2 one. It’s a big list, but hopefully manageable. Please share in comments and changes I missed so others can be helped!

First, change the framework to the new naming style. For dxcore use:

Read...


Getting Ready for ASP.NET Core RC2

I’m starting to play with the Preview of RC2 (nightly builds). It’s not time to do it for most people, but I’m trying to prepare for the update to my ASP.NET Core RC1 course on Pluralsight.

I have a couple of small library projects that I created when I build the new website. Since they are both pretty small and have xUnit testing, I thought it might be a good place to start.

I started by branching the projects so that I could merge them after RC2 shipped. The one I’ll walk you through is the MetaWeblog project. This is a small middleware for ASP.NET Core to support the Meta Weblog API to support Windows Live Writer (and other tools) for writing your blog items. You can see the comparison between the master and the RC2 branch here:

Read...


The Future of project.json in ASP.NET Core

aholebabyIf you’re not paying attention to Twitter, the ASP.NET Standup or the Github repositories, you might be missing a big change coming to ASP.NET Core. Now is time to add your opinion so that Microsoft can make the right move.

I suggest you read up on the change and make your voice heard if you have an opinion. My opinion is pretty clearly stated in the GitHub discussion so I won’t bother to repeat it here, but I’m asking you to get involved.

Microsoft has decided after the RTM of the ASP.NET Core framework to phase out project.json and use MSBuild for build data. They’ve not decided whether to keep the NuGet dependencies in a pared down project.json (maybe renamed to nuget.json) or whether to just allow for a command-line action like “nuget install dependency --save” to mirror what other package managers do.

Read...