.NET and Open Source: better together

RTur.net

  • Join Us on Facebook!
  • Follow Us on Twitter!
  • LinkedIn
  • Subcribe to Our RSS Feed

Introducing the Blogifier

I've been playing with this idea for a while now, trying different approaches, building proof of concept samples, throwing them away and starting over. Here is scenario I going after: your client asks you to build web application and, when you done, there is a little extra - "can you also add a blog to our website please? The PR people say it might come in handy and we want our product managers to engage by posting news etc. Shouldn't be too hard, right?" Well, you can add Wordpress or alike and call it a day, but what if they want it truly integrated, not another external application but part of website you just built? That would be a challenge. For example, here is 21 step (!) guide on integrating BlogEngine.Net into your application. And this is a challenge I was trying to tackle by creating Blogifier.

Blogifier is a component with common bloggin functionality - post lists, editor, content manager, RSS feed, categories etc. Point was to make it as easy as possible to plug into Visual Studio solution. I wanted to use Nuget for this, but blogging is heavy on the front-end side - scripts, styles, images, views - and Nuget deals with packaging back-end code into compiled libraries. There whole bunch of authentication libraries on Nuget for example, but they all require you build your own UI and only provide back-end functionality. I wanted adding blog really, really easy. Copying project and adding it to solution would work but seems lame - Nuget is better channel for code distribution by far. So I kept going back to using Nuget until I got whole web site compiled and packaged into set of DLLs, with all the styles and scripts. I guess this is pretty unique - at least Visual Studio completely freaks out trying to manage Razor view or JavaScript file in the class library project :)  

From technology point, I wanted cross-platform solution and went with ASP.NET Core (currently using stable 1.1). So first thing I did was setting up continues integration and deploying sample application to Azure and Digital Ocean, to test Windows and Linux in parallel. It took me about a week to reconcile differences between the two, but I think it was important to do it from the start and make Linux first class citizen and not an afterthought. 

Now I got to the point where project hits beta territory - it is usable but not completed. At this point I feel like I could use some feedback and second opinion before it is too late make any big changes. Below are links to short introductory video and project sites - everyone welcome to try it out and feedback is appreciated.

ASP.NET Globalization in BlogEngine.NET

The basic globalization in ASP.NET pretty simple: you create resource (.resx) file for every supported language and include it in App_GlobalResources. ASP.NET will compile it and load on demand. If you put your resources in labels.resx, in your code you can access individual resource like this: More...

OpenID with ASP.NET Example

In the previous post we’ve got dead simple OpenID authentication working with ASP.NET WebForms application. Lets push it further and make more real world example you can actually use in your project. To make it less work, we will use Javascript OpenID selector – handy little library to display providers and handle user input. It is just two small scripts and one CSS file, very light and easy to modify if needed. More...

OpenID with ASP.NET Made Simple

Implementing OpenID can be challenging, because of large number of scenarios and parties it can be used for and by. So any decent implementation includes lots of stuff you don’t particularly care about and it is hard to parse information to find exactly what you need. To save you some reading time, here how it works with ASP.NET application in the nutshell. More...

Optimizing ASP.NET Page Load Time

Let's start by creating new empty ASP.NET website and adding Default.aspx with minimal “hello world” markup. When you access your site and check it with profiler, you’ll see single get request for default page. More...

IIS 7 – Who is running the show?

iis7

When you run ASP.NET site in Visual Studio things generally tend to work. It usually when you try to deploy it to live server when you get into trouble. This is why I wasn’t surprised when after setting up little continuous integration server my application that ran perfectly well in VS broke apart on local IIS 7. I went to IIS console and double-checked application settings and write permissions. Along with Network Service I gave access to ASPNET account, because IIS keeps changing identity and I felt lazy to figure out what account it uses in this particular case. More...

Using machineKey with ASP.NET Membership

mbrship-1Either you run your web site in the shared hosting environment or on your local IIS server, you likely have several ASP.NET applications running in the same root directory. Each of them can be configured as a separate web application and run totally independent from others. Although BlogEngine is not (yet) multi-blogging platform, you can easily run bunch of BlogEngins on the same root for number of bloggers. Lets say, you have 3 bloggers contributing to your site and you want each of them have their very own blog, then you create similar structure: More...

Dynamic compilation in ASP.NET

We all know about magic App_Code folder. Just drop class file in there and it will become a part of the web application. This is fine for scripts like PHP or "classic" ASP (VB script), but C# is strongly typed compiled language. How App_Code works? As any magic, mostly smoke and mirrors. Behind the scene, ASP.NET will create App_Code.dll and merge it with main application assembly at run time. This simple trick gives us best of both worlds - dynamism of scripting languages (ok, to the point) and all the good stuff coming with strong typing and compilation (whatever they are). More...

Strategy pattern in C#

dp-3

Do you use design patterns in your daily development? You probably should, and if you don't you might start with reading some books on the subject. I would suggest one from Head First series, although not everybody is a big fan of this book. But I found it fun and easy reading that can trigger your curiosity and encourage you to dig dipper. It is written for Java developers, but language samples presented in the book are minimal and, if you don't understand Java, you can refer to this project for C# translation. More...

Doing Ajax using client callbacks

Yes, I've heard about Ajax before - one would have to be hiding in the hole for the last year or two to avoid the buzz. I've read articles, seen videos and presentations, even used applications that utilize Ajax on a daily basis. So I’m not exactly a newbie. But somehow I managed to stay away from it - no projects I've been involved into for the last few years used Ajax. I decided it is a shame and I want to change it. Here is a plan: for starters I'll write two small applications ("gadgets", or user controls, for BlogEngine). The first one will be using "classic" JavaScript callback approach and the other one will be doing similar stuff the Microsoft way. Then I will compare experience. Sounds fair? More...