Whether this will become a regular thing, I’m not sure. But starting this week I’ve been keeping notes on the things I’ve learned, problems I’ve faced and resources that I’ve read, watched or listened to.
I try to consume as much information as possible about ASP.NET and development in a continual drive to learn more and get better at what I do. This includes listening to a regular set of podcasts on my daily commute, reading any blog posts that I can find that relate to things I do or may be doing in the future, and watching videos online. My current focus is around ASP.NET Core so a bulk of the materials I am reading tend to be focused in that area.
I won’t go into explicit details in these posts, as realistically I won’t have time. But I hope to highlight key points of information I have found useful and to share links to things I’ve learned from, hopefully so that others sharing my passion can save some time. It’s also a shameless way to help me remember things as my brain will only hold information for so long!
Things I’ve Learned
Not an exhaustive list (as we’re always learning and that’s one of the things I love about development) but here are a few key things which came to mind after the week has ended. I’ll contain this section to small snippets of information that do not generally warrant a longer, dedicated post.
ASP.NET Core RTM SDK Tooling
I picked up on a point that Damian Edwards mentioned on the weekly ASP.NET community standup this week around the final SDK tooling where I thought I heard him say that for RTM tooling we had to be using VS 2017 when it’s released. I must admit I hadn’t realised this or considered the implications of the move to a refined csproj (from project.json) for ASP.NET Core.
I tweeted Damian to clarify this and he was kind enough to answer my questions. The outcome, as I’ve interpreted it, is that indeed there will be no supported RTM tooling for ASP.NET Core on Visual Studio 2015. The tooling we have now which is preview tooling, will remain available, but unsupported. To get a supported ASP.NET Core tooling experience, developers will need to move to VS 2017 or use VS Code.
The nature of the all new csproj format is that it cannot/will not be implemented in VS 2015. Any projects which are opened on VS 2017 will auto migrate to the newer csproj format and after that, cannot be developed on VS 2015 any longer. It also seems that when ASP.NET Core 2.x lands, that will be csproj and VS 2017 supported only.
I was a bit shocked to learn (and perhaps I was just slow on the uptake) that the above was the case. I had assumed we might get a RTM tools for VS 2015 ASP.NET Core since people have adopted this new platform and will be left with an upgrade if they do want to continue with the full IDE and proper support. Working on an open source ASP.NET Core project as I do, this means we have to think carefully about when / if we bite the bullet and force a VS 2017 / VS Code only experience by upgrading the project.
Setting cache expiry for static files using OWIN
This week I needed to ensure that javascript and css files served via our site had a proper long cache expiry to help optimise page load times. I’ve used middleware in ASP.NET Core a fair bit, but not touched the ASP.NET 4.x OWIN code much. Our project was using the Microsoft.Owin.StaticFiles.StaticFileMiddleware for serving the static files and it turned out that the change to add the Expiry header was very similar to code I’d used in ASP.NET Core for a different, but similar requirement.
In our case all I had to do was ensure that the StaticFileOptions passed into the StaticFileMiddleware included an OnPrepareResponse action to handle setting the expires header like so.
return new StaticFileOptions { OnPrepareResponse = (ctx) => { ctx.OwinContext.Response.Expires = DateTimeOffset.UtcNow.AddYears(1); } };
Misc
- In VS 2017 we will be able to remote debug ASP.NET Core over SSH.
Things I’ve Read
In no particular order here’s some of the blogs and posts I read this week.
- Fundamentals of Garbage Collection – I know a little about garbage collection at a high level, but after a colleague had some possible GC related performance issues I wanted to update my knowledge. This article was a good refresher of key garbage collection concepts.
- Common Code Style in Visual Studio 2017 – I’d read about this new feature of VS2017 a while back in the RC blog from Microsoft, but this was a nice refresher on what to expect. I like the idea of being able to apply code consistency to projects in this way.
- Designing Evolvable Web APIs with ASP.NET – Chapter 14. HttpClient – A good level of detail in this chapter to expand my knowledge around HttpClient. It looks like I need to scan through some of the other useful chapters as well!
- Bus or Queue – A nice summary of the differences between a bus and a queue.
- ASP.NET Core – Migrating to MSBuild
- Building simple plug-ins system for ASP.NET Core – I really enjoyed this example of a basic plug-in code system for ASP.NET Core.
- Building microservices with ASP.NET Core (without MVC)
- Error Handling in ASP.NET Core – I’m currently looking at logging and error handling requirements for the Humanitarian Toolbox allReady project that I contribute to. Along the way I found this a nice intro to error handling with ASP.NET Core.
- The .NET Core 2 Wave – Linked to the Eat Sleep Code Postcast below this was a nice summary of the discussion about what’s coming for ASP.NET Core developers in 2017.
- C#7: Pattern Matching – I’m looking forward to these pattern matching features in C# 7
- C#7: Throw Expressions and More Expression-bodied Members – I got a bit obsessed with Jeff regarding the new C#7 features – Here’s another one I read!
- C#7: Out Variables – And another! Nice syntax improvement when using methods with an out parameter.
- C#7: Binary Literals and Numeric Literal Digit Separators – And finally; another! I can see some cases where it would be handy using the literal digit separators.
- Performance decrease when using interfaces – An interesting GitHub issue describing the performance impact to be aware of when using lowest common denominator paramater types such as IList
Things I’ve Listened To
- .NET Rocks – Microsoft Philanthropies with Jeremy Pitman
- .NET Rocks – ASP.NET Core Opinionated Approach with Scott Allen
- .NET Rocks – Punishment Driven Development with Louise Elliott
- Hanselminutes – Vets who Code with Jerome Hardaway
- Coding Blocks – Clean Code – How to Write Amazing Unit Tests
- Eat Sleep Code Podcast – Scott Hunter and ASP.NET Core 2
- MS Dev Show – .Net Multi-Targeting with Oren Novotny
Things I’ve Watched
- Domain-Driven Design: The Good Parts – Jimmy Bogard – I’m keen to understand DDD better and this was a nice talk on some of the concepts. I’m still keen to find some more code based examples but I felt this provided some good foundations.
- ASP.NET Community Standup – I listen to this weekly to catch up on what’s happening with ASP.NET Core.
- Public speaking with Scott Hanselman, Kendra Havens, Maria Naggaga Nakanwagi, Kasey Uhlenhuth, and Donovan Brown – This really came at a great time as I start to work on my public speaking. I want to be able to share my passion for ASP.NET Core with others and while I’ve done a few smaller talks at work I want to build up the level, quality and quantity of speaking I do. I will be continuing to build my confidence in smaller groups at work but I would like to get to the point where I can do wider audiences of strangers. I have my next talk on ASP.NET Core nearly finalised for a group of developers at work.
Have you enjoyed this post and found it useful? If so, please consider supporting me: