From GitHub to Nuget via MyGet

Reading Time: 2 minutes

For Cors.ConfigProfiles, I wanted to try something I had seen before: automatically create a NuGet package when I push a new release to GitHub. To do this, I’d need a build server that would kick off when something changes in my master branch. If the build succeeds, it should look for a nuspec file (NuGet specification to build a package) and build that too, unless my build commands already took care of that. Then, I have a nupkg file: a NuGet package. The build server should then publish this new version to NuGet for me. And while we’re at it, it would be great if it would also take care of versioning my NuGet package for me, and tag the GitHub repository.

But I didn’t want to set all of this up by myself (developers are lazy, aren’t we?), so I made use of MyGet instead 🙂

Continue reading “From GitHub to Nuget via MyGet”

Cors.ConfigProfiles is here!

Reading Time: 1 minutes

After working on my previous blog post, where I had to use the EnableCorsAttribute, I thought: “Why can’t I make profiles for this in the web.config file, like you can for the OutputCacheAttribute?”

Enter my brand new, shiny NuGet package: Cors.ConfigProfiles! It enables you to use the EnableCorsAttribute just like you normally would, but you can also just give it one string parameter which then matches a profile inside the web.config file. So, for example, if you put this attribute on an API controller:

Then you can configure that profile in web.config like so:

And if you want to contribute or just inspect what I did (no unicorns involved though), the code is available on GitHub.


Adding an MVC layer on top of a Web API backend

Reading Time: 8 minutes

It might just be me, but I don’t seem to find a lot of examples out there showing how you can have an ASP.NET MVC website as a front end application using a Web API project as the backend service. Especially so when your front end is as basic as possible: I don’t want to end up storing user data twice because I need to request OAuth tokens and store refresh tokens and so on…

If you want to dive into the code that I’ve produced, you can head straight to GitHub and fetch it 🙂
For more explanation, read on.

Continue reading “Adding an MVC layer on top of a Web API backend”