Microsoft WebMatrix - Reloaded

    Everything new is well forgotten old. Apparently, guided by this principle, after 7 years, Microsoft decided to bring to life one of its old ideas - but in a new outfit. We are talking about WebMatrix, a web development platform whose beta has recently become available. Beta includes a lot of goodies - the promised IIS Express, SQL Server CE 4, and the MVC presentation engine, Razor. And also - a gallery of applications (integrated with WebPI), tools for monitoring and analyzing the site, publishing tools. But enough intros, let's see what is actually inside WebMatrix.

    However, for starters, let's see how to install WebMatrix. All you need to do is upgrade the Web Platform Installer to version 3.0, select WebMatrix from the list of products and click Install.


    Then a couple of minutes of waiting, installing all the dependencies - and now we are definitely ready to start. Let's go in order.


    Actually, the first thing a user sees after starting WebMatrix:


    To quickly create a site, WebMatrix offers to use a gallery of web applications, create a site from a predefined template, or open an existing folder containing the site. If, by and large, there is nothing to say about creating a site based on a folder - the usual web site from Visual Studio will be successfully opened in WM, then the templates and gallery are of particular interest. To begin with, let's see what ready-made templates offer us for quickly creating a site. There are 5 templates in the current beta


    Immediately make a reservation that the templates are the simplest - and this is both their advantage and disadvantage. Each site created by the template will contain a set of .cshtml pages (using Razor for rendering), an SDF database (SQL Server CE 4) and a CSS file. There are no MVC application templates, ASP.NET WebForms applications, etc. - I think all this will appear in the future. Cshtml files are pages containing markup for the new Razor engine, but now we will not dwell on this - those interested can read the translation of the entry from the ScottGu blog. In the meantime, I will dwell in more detail on a very important component of WebMatrix ...


    Web application gallery is an opportunity in 3 clicks and in a couple of minutes to install any of the many popular web applications based on the Microsoft platform - CMS, eCommerce systems, blogs, galleries, portals and much more. The application will be installed and deployed without unnecessary gestures, complicated settings - and most importantly, the installation does not require long and complicated installations of related products - everything can be installed and configured via WebMatrix with a little help from the Web Platform Installer (if you need to install Sql Server Express, eg). During the installation process, you will only need to specify the data for connecting to SQL Server (if the application does not know how to work with SQL Server Compact) - and after loading the application and all its dependencies, it will be open in WebMatrix and ready to work.


    Editors and Tools

    The shell, in addition to access to the gallery and templates, provides a set of built-in editors and tools for managing the created site - these are code editors, markup, designers and data editors for the database, site publishing tools and some tools for analyzing the web application.


    The editor supports syntax highlighting C #, VB, HTML, XML, CSS, CHTML (Razor), ASPX etc - but, at the moment, does not support Intellisence - support will appear in later versions. The creation of the structure and filling of the data of the database tables using the built-in editors is supported.
    The following tools can be distinguished as additional tools included in WebMatrix:
    1. Support for migration to SQL Server. When the capabilities of SQL Server Compact are not enough, you can easily migrate the database to SQL Server - just make two clicks (or one if the server is already installed), specify the connection parameters and wait a bit.


    2. Means of publication. In an effort to simplify not only development, but the entire life cycle of a web application, Microsoft added tools for publishing a site to WebMatrix and, in addition, even the ability to choose a hosting. Three publication models are supported - FTP. FTP / SSL and Web Deploy - using special tools from Microsoft. Incremental publication is also available - i.e. WebMatrix builds a list of locally modified files and allows you to update them on the server with one click.


    3. Analytics
    WebMatrix provides two options for site analysis - the first, analysis of all requests to the site and recommendations for increasing download time, indexability, etc. The second is an SEO Report which will provide information about the created site in terms of SEO optimization. In each of the reports WebMatrix will not only indicate problems, but will also give recommendations on how to fix it, as well as provide a description of why this or that thing is marked as problematic.



    Having dealt with the appearance and capabilities of WebMatrix, take a look “under the hood”. WebMatrix lies on three pillars - IIS Express, SQL Server Compact Edition 4, and the Razor presentation engine.

    a. IIS Express

    Already a lot has been said about him - you can read the review from ScottGu ( translation ) - or any of the many reviews that have appeared on specialized resources. Briefly summarizing what IIS Express is, we get the following:
    • Lightweight and small server for developing and testing applications, as well as for use as an embedded web server
    • Full compatibility with modules of full IIS
    • Integrated Pipeline and Classic modes
    • Support for CGI (it is possible to deploy PHP applications, for example)
    • Compatibility with IIS configuration files (applicationHost.config, web.config)
    • SSL support
    Some disadvantages also exist, such as the inability to manage through IIS Manager, only through the console utility appcmd, or by editing applicationHost.config, while (in beta) there are some difficulties with WCF support, there is no integration with VS (although this is fixable ) - but a lot will be fixed and improved in the release version.

    b. SQL Server CE 4

    New version of Embedded DBMS from Microsoft. This version made a very high-quality leap forward, which opens up completely new perspectives for it. Namely, work with the DBMS in multithreaded mode is finally implemented. If you had to write your own abstraction levels that were involved in managing access to the database, now SQL Server CE does not have this serious limitation. Thus, it becomes possible to use it even in web applications. Moreover, SQL Server CE 4 does not require installation! Those. to add support for this DBMS to the web application, just copy the set of necessary assemblies to the bin folder - that’s all. Also, SQL Server can successfully function in a Medium Trust environment, i.e. he is open to the road to most shared hosting.
    One of the advantages of SQL Server CE is the affordable provider for Linq2Sql, the Entity Framework, syntax compatibility with adult SQL Server and, accordingly, easy migration to a full-fledged server - with a minimum of code rewriting. In short, SQL Server CE 4 is an ideal choice for rapid prototyping or use in small, unloaded projects - with the ability to quickly switch to a full SQL Server.

    c. Razor

    With the advent of the MVC Framework, ASP.NET developers have developed a powerful, mainstream alternative to WebForms. She brought some new paradigms and in general - looked "easier" than WebForms. In this concept of laconicism and grace, the new engine for generating performances - Razor, ideally blended. It will be part of the ASP.NET MVC Framework version 3 (which will even make you choose the engine at the time of creating the View), now it is available for review through WebMatrix. You can read more about it and see examples of use in articles ( 1 , 2 ) on the hub, in the blog of Scott Guthrie.


    So, summing up everything described above - what exactly is Microsoft WebMatrix:
    1. A lightweight, integrated, "all-in-one" development environment for web applications based on technologies from Microsoft
    2. A nice and lightweight interface for the developer
    3. Development tools , optimization, analysis of web applications and for their publication
    WebMatrix is ​​ideal for developers who are just new to Microsoft web technologies or want to upgrade from other platforms. It can be used, for example, in schools - in classes with an in-depth study of computer science, which involve the development of web applications. Also - at junior university courses or at courses where web development is not a core subject - or for beginning developers who sacredly believe in the myth that everything except PHP is "complex and OOP." And with the development of the platform - whoever knows - it can become a good alternative to Visual Studio Express Web.

    Also popular now: