Uploading Resources to Blob Storage During Continuous Deployment using Kudu

In  my last post, I wrote about how to run Gulp as part of your deployment process when doing continuous deployment from GitHub to an Azure Web App using Kudu. As part of that post, I used Gulp to generate bundled and minified JavaScript and CSS files that was to be served to the client.

The files were generated by using Gulp, and included in the deployment under a directory called dist. However, they were still part of the website. So they are still taking up resources from the webserver as they need to be served from it. And also, they are taking up precious connections from the browser to the server… By offloading them to Azure Blob Storage, we can decrease the amount of requests the webserver gets, and increase the number of connections used by the browser to retrieve resources. And it isn’t that hard to do…

More...

Running ASP.NET 5 applications in Windows Server Containers using Windows Server 2016

A couple of days ago, I ended up watching a video about Windows Server 2016 at Microsoft Virtual Academy. I think it was A Deep Dive into Nano Server, but I’m not sure to be honest. Anyhow, they started talking about Windows Server Containers and Docker, and I got very interested.

I really like the idea of Docker, but since I’m a .NET dev, the whole Linux dependency is a bit of a turn-off to be honest. And yes, I know that ASP.NET 5 will be cross-platform and so on, but in the initial release of .NET Core, it will be very limited. So it makes it a little less appealing. However, with Windows Server Containers, I get the same thing, but on Windows. So all of the sudden, it got interesting to look at Docker. So I decided to get an ASP.NET 5 app up and running in a Windows Server Container. Actually, I decided to do it in 2 ways, but in this post I will cover the simplest way, and then I will do another post about the other way, which is more complicated but has some benefits…

More...

DotNetRocks with Carl Franklin and Richard Campbell

A while back, at NDC Oslo, I was approached by Carl Franklin and Richard Campbell regarding joining them for an episode of their podcast DotNetRocks. Obviously I said yes without hesitating! Who wouldn’t!? Unfortunately there were some scheduling problems, so we couldn’t do it during NDC. So instead, we did it over Skype a week or so later. And it has now finally been published on the DotNetRocks website.

The topic for the episode is the SOLID principles, which I have been talking about at quite a few conferences now. It was nice talking about these principles under these relaxed circumstances, without getting some of the flaming that I get ever so often for being a bit too pragmatic about the whole thing. Hopefully people will enjoy listening to it, and get some thoughts and ideas about how to work with SOLID in there projects. So go ahead and have a listen at http://bit.ly/dotnetrockssolid.

Trying to understand the versioning “mess” that is .NET 2015

Right now there is a lot of talk about the next iteration of the .NET platform, and the different versions and runtimes that is about to be released. Unfortunately, it has turned into a quite complicated situation when it comes to the versions of things being released.

I get quite a few question about how it all fits together, and I try answering them as best as I can. However, as the question keeps popping up over and over again, I thought I would sum up the situation as I have understood it.

Disclaimer: Everything in this post is “as I have understood it”. I am not working for Microsoft, and I am in no way or form guaranteeing that this is the right description. This is just how I understand the situation. Hopefully it is fairly close to the real world.

More...

The code from my SweNug presentation about what OWIN is, and why it matters…

Most of you can ignore this post completely! But if you attended SweNug today (September 10th), you know that I promised to publish my code. So here it is!

Code: SweNug.Owin.zip (2.30 mb)

I’m sorry for the ridiculous size of the download, but all the solutions have NuGet package restore enabled, which places an exe to restore NuGet packages in the project. This exe is quite sizable, so the download gets a bit large. On the other hand, including all the NuGet packages would make it even larger…

If you have any questions, don’t hesitate to drop me a line!

Combining ASP.NET MVC and Web API for content negotiation goodness

Ok, so this post sprung out of an idea that I have had in my head for a while. I know it will probably be solved better in ASP.NET v.Next, and can probably be solved in a bunch of other ways using only Web API or only MVC, but I wanted to see if I could use both to do it…

So what is IT? Well… In Web API, we have the ability to use content negotiation out of the box. Unfortunately, that content negotiation is, at least by default, based around serializing to XML or JSON. It doesn’t include all the view goodness that MVC has. There is no simple way to ask Web API to return a Razor view… So if I want to have content negotiation to handle both serialized data and views, we need to do some work…

On top of that, my solution would work nicely together with an existing MVC application, making it “easy” to add API features and content negotiation to the existing MVC URLs.

More...

Code from my MVVM presentation at DevSum14

During my MVVM presentation yesterday, I promised to upload the code to my blog. So here it is! Go ahead and run the application, put some breakpoints in there and see what is actually happening. It should give you a good baseline for a simple, and small “pay for play” MVVM framework. And if you have any questions, Just ask them in the comments, or via e-mail or Twitter…

Download: FiftyNine.MVVM.zip (517.57 kb)

Understanding OWIN – more on the IAppBuilder abstraction and middleware creation

In my last couple of posts, I have talked about OWIN. What it is, how it works, why it is interesting and so on. I have talked mostly about the hosting side of it, and a bit about how we can plug into the OWIN pipeline using what is called middleware… However, so far, the middleware has been ridiculously simple, and done very little, which isn’t really helpful I guess. And besides not doing very much interesting work, they have also not interacted very much with the request pipeline. Most of them, or maybe even all of them, have just terminated the pipeline and returned a simple response…

In this post, I want to take a look at how OWIN abstracts the server, and the request and response, and also how we can use this abstraction to extend the functionality of our pipeline.

More...

Understanding OWIN – more on hosting

My last post about OWIN covered a little bit about the different hosting options, and then quite a bit about OWIN middleware. However, I found the hosting coverage to be a little weak, so I thought I would do one more, much shorter post, on just the different hosts available.

As mentioned before, there are 4 different OWIN hosts available from Microsoft. 3 from project Katana and one from project Helios.

Actually, there are 5. There is also a test host that can be used to test OWIN middleware in Unit tests etc in-memory, instead of having to open a port and listen for incoming requests…

The first, and simplest to get started with is the Katana self-host. But since we saw that being used in the last post, I will skip that one…

More...

Code from my TechEd talk about SOLID

Ok, so I thought I would upload the code from my TechEd presentation about the SOLID principles here. But before you go and download it, I want to mention that it is a contrived example, and that it might not be “proper” SOLID in all places. However, that is what you get when you have to present an application, and go through all the SOLID principles using it, in 1 hour and 15 minutes… Winking smile

Code available here: TechEd.Demo.SolidPrinciples.zip (538.16 kb)