📜 ⬆️ ⬇️

Microsoft WebMatrix - Reloaded

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

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


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


Actually, the first thing that a user sees after launching WebMatrix:


To quickly create a website, WebMatrix suggests using a web application gallery, creating a website from a pre-installed template, or opening an existing folder containing a website. If, on the whole, there is nothing to say about creating a site based on a folder - the usual Visual Studio web site 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 to quickly create a website. There are 5 templates in the current beta.


At once I will make a reservation that the templates are the simplest - and this is at the same time their merit and disadvantage. Each template created site 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 templates for MVC applications, 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 for now let's not stop there - those interested can read the translation of the entry from the ScottGu blog. In the meantime, I’ll dwell on a very important component of WebMatrix ...


Web application gallery is an opportunity for 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 will not require long and complicated installation of related products - everything can be installed and configured through WebMatrix with a little help from Web Platform Installer (if you need to install Sql Server Express, eg). During the installation process, you only need to specify the data to connect to SQL Server (if the application does not know how to work with SQL Server Compact) - and after the application is loaded and all its dependencies, it will be opened in WebMatrix and ready to go.


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 editors, codes, markups, designers and data editors for the database, website publishing tools and some web application analysis tools.


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 content of the database tables using the built-in editors is supported.
As additional tools included in WebMatrix, the following can be highlighted:
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 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 the development, but also the entire life cycle of a web application, Microsoft added tools to WebMatrix to publish the site and, moreover, even the ability to select hosting. Three publishing models are supported - FTP. FTP / SSL and Web Deploy - using special tools from Microsoft. Also, incremental publishing is 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 analyzing the site - the first, the analysis of all requests to the site and recommendations for increasing download time, indexing, etc. The second is SEO Report which will provide information about the created website from the point of view of SEO optimization. In each of the reports, WebMatrix will not only indicate problems, but also give recommendations for corrections, 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, look "under the hood." WebMatrix lies on three pillars — IIS Express, SQL Server Compact Edition 4, and the Razor view engine.

a. Iis express

Not a little has already been said about it - you can read a review from ScottGu ( translation ) - or any of the many reviews that appeared on specialized resources. To summarize briefly what IIS Express is, we get the following:
• Light and small server for developing and testing applications, as well as for use as embedded web-server
• Full compatibility with modules full IIS
• Integrated Pipeline and Classic modes
• CGI support (it is possible to deploy PHP applications, for example)
• Compatible with IIS configuration files (applicationHost.config, web.config)
• SSL support
Some shortcomings are also present, such as the inability to manage through the IIS Manager, only through the console utility appcmd, or editing applicationHost.config, while (in beta) there are some difficulties with WCF support, there is no integration with VS (although this is fixable ) 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 qualitative leap forward, which opens up completely new perspectives for it. Namely - finally implemented work with the database in multi-threaded mode. If before that you had to write your own levels of abstraction, which were engaged in controlling access to the database, now SQL Server CE is deprived of 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 a web application, just copy the set of necessary assemblies to the bin folder - that's all. Also, SQL Server can function successfully in the Medium Trust environment, i.e. he is open to most shared-hosting sites.
Also from the advantages of SQL Server CE can be noted - an affordable provider for Linq2Sql, Entity Framework, syntax compatibility with an 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 transition to a full-featured SQL Server.

c. Razor

With the advent of the MVC Framework, ASP.NET developers have a powerful, mainstream alternative to WebForms. It brought some new paradigms and, in general, looked “lighter” than WebForms. This concept of brevity and grace perfectly fit the new engine for generating views - the Razor. It will be included in the ASP.NET MVC Framework version 3 (which even allows to choose the engine at the stage of creating the View), now it is available for review in the framework of WebMatrix. About him you can read more and see examples of use in articles ( 1 , 2 ) on Habré, in the blog of Scott Guthrie.


So, summing up everything described above - what is Microsoft WebMatrix:
1. A lightweight, integrated, all-in-one development environment for web applications based on Microsoft technologies.
2. Pleasant and lightweight developer interface
3. Means for developing, optimizing, analyzing web applications and publishing them.
WebMatrix is ​​ideal for developers who are only familiar with Microsoft web technologies, or who wish to migrate from other platforms. It can be used, for example, in schools - in the classroom with in-depth study of computer science, which involve the development of web applications. Similarly, at university undergraduates or at courses where web development is not a core subject - or for novice developers who firmly believe in the myth that everything except PHP is “complex and OOP”. And with the development of the platform - someone knows - can be a good alternative to Visual Studio Express Web.

Source: https://habr.com/ru/post/101947/

All Articles