Tagged with asp.net core
When 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.
I’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:
Just 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:
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:
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.
I 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:
Developers 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.
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.
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 Klug, Maarten Balliauw, and Frans Rosén). It was a great day of .NET and C# content:
I’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:
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:
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:
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:
I 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:
When 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”
I’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.
I’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.
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:
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.
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”
This 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.
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:
With 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:
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:
If 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.