activa's blog

.NET, Web, Mobile and more stuff I can't stop talking about

Browsing Posts published by Philippe Leybaert

Without going into specifics, ProMesh.NET is a web application framework based on the ASP.NET HTTP “Pipeline”.

Key points about the framework:

  • Avoids the ASP.NET page model, so no ASP.NET web controls
  • Links directly into IIS using Http Handlers and Http Modules
  • Template-based system with master templates and content templates. Very powerful built-in or runtime server-generated macros can be embedded in the templates.
  • Templates can be created using off-the-shelve HTML editors like Dreamweaver and Microsoft Web Expression
  • Full control of the rendering process
  • Integrated with CoolStorage.NET
  • Built-in logging and statistics

The project will probably be released as open source at CodePlex.

This framework has been used for internal projects for several years, including some high traffic sites like www.autosport.be and www.cartoonbase.com, so stability and performance have been proven. Now it’s time to release it in the open…




This weblog is sponsored by The Vici Project.
I am often asked the question “Can’t I just RUN my Windows Service without installing and starting it?”.

My answer usually is “No, you can’t but…”

There is a “but”: you can create your Windows service as a hybrid application, so it will run as a console application also.

Why would you want to do that?

  • It makes debugging from within Visual Studio a breeze
  • Sometimes you want to show some debugging information in a production environment by using Console.WriteLine()
  • You don’t always want to install your service to see if it runs in a particular environment

Turning a .NET Windows service into a hybrid application is actually very simple. In your Main() method you add the following:

static class Program{  static void Main(params string[] parameters)  {    if (parameters.Length > 0 && parameters[0].ToLower() == "/console")      new MyService().RunConsole(parameters);    else
      ServiceBase.Run(new ServiceBase[] { new MyService() });   }}

Then, in your service class, add a RunConsole() method:

   public void RunConsole(string[] args)   {      OnStart(args);

      Console.WriteLine("Service running... Press any key to stop");

      Console.Read();

      OnStop();   }

That’s all there is to it. To run your service as a console app, just specify “/console” as the first paramter when running the .EXE.

UPDATE: all of this, and more is now all wrapped in a .NET library (open-source) named Vici WinService.




This weblog is sponsored by The Vici Project.

I
just added support for SQLite 3 to CoolStorage.NET (my object mapping
library). I used the open source System.Data.SQLite ADO.NET provider
which seems a pretty solid product.

Adding support for this “lite” database was pretty straightforward.

The
only problem I had was with quoted identifiers: identifiers can be
quoted using double quotes, but they behave a bit strange. For example,
if you want to quote the identifiers in this query:

SELECT c.CustomerID, c.Name from tblCustomer c

you would write:

SELECT “c.CustomerID”, “c.Name” from “tblCustomer” c

This doesn’t work. You get the following result set:

c.CustomerID c.Name
c.CustomerID c.Name
c.CustomerID c.Name
c.CustomerID c.Name
c.CustomerID c.Name

To fix this, you need to change it to this:

SELECT “c”.”CustomerID”, “c”.”Name” from “tblCustomer” c

Other than that, I’m pretty impressed (so far)

Technorati Profile




This weblog is sponsored by The Vici Project.

Nothing really, if you use it for simple personal projects. Once you start building web applications that are a bit more complex, you start running into all kinds of problems.

What kind of problems am I talking about?

  • Building web sites in multiple languages is a major pain in the butt. Once you have 2 or more languages to support, and a few hundred pages, maintaining the resource files is hell. Especially when you are using a version management system (as you should) and have people dedicated to translating stuff.
  • The event model Microsoft magically weaved in ASP.NET is not suited for web applications. HTTP wasn’t meant for a user interface framework based on events. Period.
  • Performance of the ASP.NET page rendering system is extremely slow. There are caching techniques, but these are hard to use and even harder to maintain.
  • ViewState ! Anyone who has done some serious work using ASP.NET will know exactly what I’m talking about.
  • Building standards-based websites (using CSS) is extremely hard (there are CSS “adapters” available, but they are hardly easy to use)
  • The Microsoft Ajax framework is a monster (both in size and usability)

When building web applications, I only use the first steps in the ASP.NET pipeline: Http Handlers and Http Modules. Page rendering is done using a multi-language template engine combined with a logging framework for page/session/visitor/cookie tracking.

Of course, when you don’t use the ASP.NET page model, you have to know a little bit about HTTP and HTML/CSS, but I wouldn’t call this a bad thing. Many web developers these days know nothing about “low level” web technology, meaning they get into trouble when something “special” or “low-level” needs to be done. I prefer to have control over the whole process: gets, posts, urls, parameters, form variables, etc.

A presentation of the framework I built will follow in my next post.

The title says it all :-)

Seriously, it’s about .NET programming, but without the ASP.NET page rendering model.

While the .NET Framework and C# are one of the best ways to do any software development since C++, the ASP.NET page model has some serious flaws. For serious web development work, it is a major pain in the butt.

I have been using .NET (C#) for web development projects since 2001, but I have never used ASP.NET pages and controls (I did use them for some contracting work, but I was less than impressed).

In this blog I will talk about ASP.NET programming without the classic ASP.NET page model. While I’m at it, I will also mention CoolStorage.NET (my ORM tool) once in a while.