European Windows 2012 Hosting BLOG

BLOG about Windows 2012 Hosting and SQL 2012 Hosting - Dedicated to European Windows Hosting Customer

European WebMatrix Hosting - Amsterdam :: Deploy your Web Application with HostForLIFE.eu

clock October 15, 2012 08:24 by author Scott

Getting Ready to Publish

Before you publish your site to the world-wide-web it is a good idea click on the ‘Reports’ tab and ask WebMatrix to run a full site report. The generated report includes useful information on the site’s performance and hints on Search Engine Optimisation (SEO), to help make your site more visible to popular search engines such as Yahoo, Google and Bing.



To correct any errors or warnings simply click the ‘Edit this page’ link to be taken directly to the area of concern.




At this point it is also worth proof-reading your content and using the ‘Run’button on the toolbar to carry out cross-browser compatibility checks to ensure an optimal experience for all your users.


Once you are satisfied that your web site is ready for publication it is time to find a suitable hosting provider.


Finding a Hosting Provider

WebMatrix has a facility designed to help you find a suitable host for your web site. If you already have an account with a web hosting provider you may want to skip to the next section, ‘Configuring WebMatrix Publish Settings’.




By clicking on the ‘Need web hosting for your web site?’ button on the ‘Site’tab of the WebMatrix home page you will be directed to the ‘Find Web Hosting...’ page of the Microsoft web site.



WebMatrix passes some basic information about your web site to this page in order to generate a list of hosting plans tailored to meet the requirements of your site. The results can be filtered and the criteria changed, using the tools on the page.


You should be careful about changing some of these settings, in particular the scripting language; otherwise you could end up purchasing an account on a web server which won’t support the language in which your site has been written. If you are unsure of the scripting language you should leave it set to its default of ASP.NET 4.0. This is the default scripting language for all new WebMatrix projects.


The filters for minimum and maximum price, storage (GB), number of SQL databases, number of e-mail accounts and bandwidth per month can be set using the sliders.


The initial storage required for your site can be estimated by viewing the folder properties of your local site in Windows Explorer. However, this should only be taken as a guide as the overall required storage depends a great deal on the features of your site. For example, if your site has a facility to allow users to upload content, or contains a blog which will grow over time, be sure to allow for future expansion. Generally though web sites primarily consist of text files and small images and do not require a huge amount of disk space.


If your site requires the use of a database other than SQL Server Compact you will need to find a web host which has this facility. If you are using SQL Server or MySQL, WebMatrix will automatically publish scripts to create tables and insert data to replicate the schema and data on your development computer. These scripts will need to be run on the database provided for you by your chosen hosting provider, usually through the host’s control panel.


If you are using a SQL Server Compact database there is no need to choose a host with additional database facilities as SQL Server Compact is file-based, which can deliver a significant cost-saving in some cases. If you do choose this option though it is important to consider the disk-space required to store the database files - SQL Server Compact databases can grow to a maximum of 4GB in size. In addition to the SQL Server Compact (.sdf) file containing the data, WebMatrix will also upload the database program itself to the web server to ensure the site will work even if SQL Server Compact is not already installed.


To set up a new account, choose a suitable provider and click the green ‘Learn More’ button. This will display more information about the hosting package and a link to ‘Sign Up’ on the hosting company’s web site.


Configuring WebMatrix Publish Settings

Once you have chosen and purchased a hosting plan, the provider will typically send you an email confirming the details of your account and the information necessary to configure WebMatrix for publishing. This information will be provided either as a list of settings or as a .PublishSettings file.


Configuration Using A Publish Settings File


If your hosting company has provided you with a .PublishSettings file, this is the easiest way to set up publishing within WebMatrix.



To open the ‘Publish Settings’ dialog click the ‘Set up the remote publishing location for your web site’ button in the ‘Site’ tab of the WebMatrix home page.




Click on the ‘Import Publish Settings’ link and browse to your Publish Settings file. This will populate the Publish Settings dialog for you, including connection strings for any non-SQL Compact databases you may be using.


Click the ‘Validate Connection’ button to have WebMatrix check the settings and click ‘Save’.


Manual Configuration Without A Publish Settings File

If your web hosting company has not provided you with a .PublishSettings file it is easy to configure the Publish Settings manually using the host settings, usually sent to you in your confirmation email or available through the host’s control panel.




If you selected your hosting provider through WebMatrix you can leave the Protocol drop-down set to ‘Web Deploy’. If you did not choose your hosting provider through WebMatrix and your host does not support Web Deploy, you should skip ahead to the next section, ‘Configuring Publish Settings Using FTP’.


Enter the information provided to you by your web host into the boxes provided:


·
Server– This is typically referred to as the ‘Server Name’ or ‘Service URL’.

o E.g.- server.sample.com


·
User Name& Password – These are usually chosen by you at sign up, although alternatives for publishing may be set by the provider.

·
Site Name– Web hosting companies often refer to this as the ‘Site’ or ‘Site/Application’

o E.g.- site.server.sample.com


·
Destination URL – This is the URL that will be used to browse to your site.

o E.g.–
http://site.server.sample.com

Once you have entered all of the required information, click the ‘Validate Connection’ button to verify that WebMatrix can successfully connect to your hosting account and click ‘Save’.


Configuring Database Connections

If your web site is using a database other than SQL Server Compact, your site will need a web.configfile that tells the site how to connect to the database on your local development machine. When you add a database through the ‘Connect to Database’dialog in the ‘Databases’ tab, the file is automatically created and configured for you and looks something like this:


01.<?xml version="1.0" encoding="UTF-8"?>
02.
03.<configuration>
04.
05. <connectionStrings>
06.
07. <add connectionString="Uid=testUser;Server=testDBServer; Pwd=passw0rd; Database=testDB" name="testDB" providerName="System.Data.SqlClient" />
08.
09. </connectionStrings>
10.
11.</configuration>


Your web host will provide you with a connection string, or a series of settings, for connecting to the hosted database which you should enter in the‘Publish Settings’ dialog box.



These settings tell WebMatrix how to connect to the live data and overwrite the web.config settings on the host server.

Publishing Your Site to the World Wide Web

OK, so you have checked your site for errors, selected a web host and configured the WebMatrix Publish Settings; it’s time to publish your site.

The first time you click the ‘Publish’ button on the WebMatrix toolbar, a dialog will appear asking whether you would like WebMatrix to test your sites compatibility and adjust .NET settings on the remote server if necessary. Click ‘Yes’ to proceed with the test:



Once the test is complete the ‘Publish Preview’ dialog will be displayed. This dialog allows you to check the list of files to be published and make changes as necessary.


If this is the first time you have published your site you should ensure that you check the boxes next to any necessary databases, to have MebMatrix include them in the file upload. On subsequent publishes only the changed files will appear in this dialog, enabling you to easily keep your local development and remote hosted sites synchronized.




Once you are happy with your selection, click ‘Continue’ to publish your web site.


The yellow bar at the bottom of the screen will show the progress of file uploads and let you know when the publishing has been completed:




And that’s it! You have seen how easy it really is to find a suitable web site host and deploy feature-rich, dynamic, data-driven websites to your web server, using the power and flexibility of Microsoft WebMatrix.

 



European Web Deploy Hosting - Amsterdam :: Common Error in Web Deploy and How to Solve it

clock April 20, 2012 11:33 by author Scott

In this post, I will show you common error in Web Deploy and how to solve it. Here are the most common publishing errors and solutions for them:

Error: “The application pool that you are trying to use has the ‘managedRuntimeVersion’ property set to ‘v2.0′. This application requires ‘v4.0′.”


Solution
: An application pool provides isolation for websites. Typically, web hosting providers create one application pool per website, and set default values for a number of attributes. One of these attributes is the version of the .NET framework. The user can often change this value between .NET 2.0 and .NET 4.0 through the web hosting provider’s control panel. You will see this error during publishing if you are publishing an ASP.NET Web Pages application, which requires .NET 4.0, to a hoster who has given you a website with a .NET 2.0 application pool. Similarly, you will see this error if you are publishing an application that requires .NET 2.0 to a website associated with an .NET 4.0 application pool. The solution is to set the .NET framework version in the web hosting provider’s control panel or, if there are no compatibility issues, change your application’s .NET framework version in WebMatrix’s Settings workspace.

Error: “Username or password incorrect” error when using Web Deploy

Solution
: This is probably because the value in Site Name is incorrect. Site Name must contain the name of the IIS site on the remote server. Typically, it matches your domain name, but it doesn’t have to. For example, it can be “Default Web Site” (if you have a dedicated server) or “foo” or “foo.com”. Web Deploy must authenticate to the site before it can execute any providers.

Error: Web management service not started on destination

Solution
: You may see this error if you are deploying to a server you have set up yourself. Web Deploy requires a service called Web Management Service (wmsvc) to be running on the remote server. You can get this error if the service is not started. This blog post is a good starting point to learn how to configure a remote server with Web Deploy and wmsvc.

Error: Failed to invoke provider “iisApp”

Solution: Under the covers, WebMatrix users Web Deploy’s iisApp provider to sync files and directories, and to mark folders as applications. You may see this error if delegation rules are not configured correctly on the remote server. Delegation rules allow the user to execute some actions that require administrative privileges, such as marking a folder as an application. This blog post and this one gives good information on how to configure delegation rules.

Error: Bad gateway: check proxy settings

Solution
: This one is literally what it says – check proxy settings because Web Deploy traffic is being blocked. Try installing your corporation’s required firewall client, and disabling all settings in Internet Explorer > Tools > Options > Connections > LAN settings.

If you need Web Deploy hosting, please consider us as we support Web Deploy. Please visit our site at http://www.hostforlife.eu for more information.



European Web Deploy Hosting - Amsterdam :: Common Error in Web Deploy and How to Solve it

clock April 20, 2012 11:33 by author Scott

In this post, I will show you common error in Web Deploy and how to solve it. Here are the most common publishing errors and solutions for them:

Error: “The application pool that you are trying to use has the ‘managedRuntimeVersion’ property set to ‘v2.0′. This application requires ‘v4.0′.”


Solution
: An application pool provides isolation for websites. Typically, web hosting providers create one application pool per website, and set default values for a number of attributes. One of these attributes is the version of the .NET framework. The user can often change this value between .NET 2.0 and .NET 4.0 through the web hosting provider’s control panel. You will see this error during publishing if you are publishing an ASP.NET Web Pages application, which requires .NET 4.0, to a hoster who has given you a website with a .NET 2.0 application pool. Similarly, you will see this error if you are publishing an application that requires .NET 2.0 to a website associated with an .NET 4.0 application pool. The solution is to set the .NET framework version in the web hosting provider’s control panel or, if there are no compatibility issues, change your application’s .NET framework version in WebMatrix’s Settings workspace.

Error: “Username or password incorrect” error when using Web Deploy

Solution
: This is probably because the value in Site Name is incorrect. Site Name must contain the name of the IIS site on the remote server. Typically, it matches your domain name, but it doesn’t have to. For example, it can be “Default Web Site” (if you have a dedicated server) or “foo” or “foo.com”. Web Deploy must authenticate to the site before it can execute any providers.

Error: Web management service not started on destination

Solution
: You may see this error if you are deploying to a server you have set up yourself. Web Deploy requires a service called Web Management Service (wmsvc) to be running on the remote server. You can get this error if the service is not started. This blog post is a good starting point to learn how to configure a remote server with Web Deploy and wmsvc.

Error: Failed to invoke provider “iisApp”

Solution: Under the covers, WebMatrix users Web Deploy’s iisApp provider to sync files and directories, and to mark folders as applications. You may see this error if delegation rules are not configured correctly on the remote server. Delegation rules allow the user to execute some actions that require administrative privileges, such as marking a folder as an application. This blog post and this one gives good information on how to configure delegation rules.

Error: Bad gateway: check proxy settings

Solution
: This one is literally what it says – check proxy settings because Web Deploy traffic is being blocked. Try installing your corporation’s required firewall client, and disabling all settings in Internet Explorer > Tools > Options > Connections > LAN settings.

If you need Web Deploy hosting, please consider us as we support Web Deploy. Please visit our site at http://www.hostforlife.eu for more information.



European WebMatrix Hosting - Amsterdam :: How does Web Deployment with VS 10 & MSDeploy Work?

clock February 28, 2012 06:21 by author Administrator

In VS 10 we use MSDeploy behind the scenes to deploy your entire web application along with all of its dependencies like IIS Settings, DB, web content etc to any destination server.

MSDeploy is a new technology specially designed to serve the purpose of deploying web applications seamlessly across IIS Servers. My hope is to give you a CONCEPTUAL high level overview to understand how web deployment with VS10 & MSDeploy really works.

In case of web deployment or replication across server farms what you really require is to take the web and its dependencies from one box to another. To further over simplify there is a source (your dev box) and there is a destination (your web server), the source needs to be replicated on to the destination and that is what we are trying to achieve (with of course a lot more details behind the scene :-)

MSDeploy uses this simple concept of taking the source and applying it on to the destination. Let us try to understand what all are possible sources:

Source:

-
If you want to deploy the site you are developing on your dev box then now the site you are developing on the dev box becomes the source.
-
If you have your web content stored in the source control and you have a build server which is set up for automatic deployment then the build server becomes the source.
-
If you have a MSDeploy web package given to you by someone and you are trying to install it on your dev box then the web package becomes the source.

Destination:

-
If you are deploying a web to a test server then the test server is the destination.
-
If you are creating a web package out of your web site using MSDeploy then the web package becomes the destination.
-
If you are deploying to your own dev box for testing purposes then in this case your dev box itself becomes the destination.

Well the concepts of source and destination are pretty simple but the reason why they are so interesting is because when you set up your deployment settings in Visual Studio then VS creates something that we call as Source Manifest and feeds to MSDeploy. Check out the figure below which gives you an idea of how VS 10 will produce your web package:



Source Manifest is a simple XML which instructs MSDeploy on what all Providers to invoke on the source machine. So what is a MSDeploy Provider?

A MSDeploy provider is a simple object which MSDeploy engine invokes to do two major CONCEPTUAL tasks:

1. On Source Machine to GET the right content from its place

e.g. if you had Database attached to your web then at source DB Provider will be called to pull out your data and schema and convert it into SQL Scripts which will then go into the web package.

2. On Destination Machine to PUT the right content in its place

e.g. if there were SQL scripts in your web package then at destination DB Provider will be called to run the SQL command and the SQL scripts to create and set up the database

MSDeploy comes with a lot of pre-built providers like:

-
IIS Settings providers for IIS 5.1 (for XP), IIS 6.0 (for Win2K3) & IIS 7.0(for Vista & Win2K8)
-
DB Provider for MS SQL Server
-
GAC
-
COM
-
Registry
-
etc etc

Based on your project settings Visual Studio creates a source manifest which is fed to MSDeploy to create package or deploy your web application. So on the source box below is how MSDeploy works:



Along with creating the source manifest, Visual Studio also creates destination manifest for you. Check the below diagram:



When you are ready to deploy then on the destination you can feed the web package and the destination manifest to MSDeploy to deploy your web site. In the destination manifest you can change the values like “IIS Application Name”, “DB connection strings” etc.



This is how you can use web packages on any machine with MSDeploy and by configuring your deployment options in the destination manifest you can go and and easily recreate your webs.

It is not possible for someone to come up with every possible provider that everyone needs so there will be an extensibility model by which you can write your own providers and register it with MSDeploy engine.

Visual Studio is also made extensible to allow you to hook into the packaging and publishing process to call your custom MSDeploy providers in the source manifest.

The most interesting pieces is that with IIS Manager and Visual Studio 2010 UI, you will not really need to know all these details, things will just work but I thought it is often interesting to know how things work behind the scenes.

I hope this conceptual overview helps you get the perspective on how web deployment with VS 2010 and MSDeploy will work!!

 



European WebMatrix Hosting - Amsterdam :: Error Message When Use WebDeploy

clock February 22, 2012 05:35 by author Scott

This is an error message that sometimes you might see when you published your site with WebDeploy. Yeah, we know WebDeploy sometimes is hard and not so easy as you think, but if you have problem with your current provider, you can consider our hosting plan. We support WebDeploy and we are Microsoft certified partner. Ok, let’s go to the problem:

“Error: An unsupported response was received. The response header ‘MSDeploy.Response’ was ” but ‘v1′ was expected.
Error: The remote server returned an error: (401) Unauthorized.”

This means that you do not have access. So, you need to create ticket to us and then we will set a username and password for your both your web deploy and remote IIS user.

Maybe you find another problem like this:


Error: The remote server returned an error: (503) Server Unavailable. Web Deploy may not be setup or running on that server. Please contact us in order to resolve the issue.

An error occurred when the request was processed on the remote computer.
The server experienced an issue processing the request. Contact the server administrator for more information.


This is the most common error we see and, unfortunately, it does not tell you much. What this means is that, usually, you have successfully connected to the server, however for some reason your deployment failed. Usually, this means that you are attempting to do something that you do not have access to do (such as deploying to the root directory – which you need full control permissions in order to do and this must be granted by us). Please check your settings and ensure that everything is correct. Also, if you do contact us, providing a screenshot of your deployment settings (Service URL, Site/Application and Username/Password) will assist us in troubleshooting your issue.

Lastly, I want to talk about the SetAcl deployment handler. Once you decide to publish to your root directory you can do some damage by removing the permissions from your files/folders if you aren’t careful. In order to fix this each file/folder must be reclaimed and the permissions reset, which is quite a bit of work and very time consuming for us.

SetAcl can be found in your WAP project file.

What is SetAcl?
It’s a provider that lets you set permissions on file system objects. Typically, this involves setting permissions on a sub-folder of your application, such as App_Data.

Let’s say you run this command:

msdeploy.exe -verb:sync -source:setacl -dest:setacl="Default Web Site",setacluser=ApplicationPoolIdentity,setaclaccess=Read

This command will give the ApplicationPoolIdentity Read access to the App_Data folder. Before it does that, however, it will clear existing permissions on the folder for the identity. This makes sense, since setAcl has to set the correct permissions and the only way to do that is to clear existing permissions for the identity. For example, if the ApplicationPoolIdentity had Read,Execute permissions before, now it will just have Read permissions.

In order to disable it, you edit the .csproj file and set:

1. <IncludeSetAclProviderOnDestination>False</IncludeSetAclProviderOnDestination>

or do this from the command line:

2. msbuild.exe myproject.csproj /p:IncludeSetAclProviderOnDestination=False

Following the above instructions will allow you to safely deploy to the root directory.

Hope this article will help you if you find problem like above.



European WebMatrix Hosting - Amsterdam :: How to Enable Xdebug in WebMatrix

clock February 14, 2012 06:41 by author Scott

Xdebug is a very popular PHP extension that helps with debugging and profiling of PHP scripts by providing a lot of valuable debug information. Microsoft WebMatrix is a development tool for building web applications. When WebMatrix is used to build or modify a PHP-based web application the debugging tasks can be greatly simplified if Xdebug extension is used. This post explains how to install and use Xdebug extension with WebMatrix.

Step 1: Enable PHP in WebMatrix from the site “Settings” page:



Note that if you installed any of the PHP applications from the Application Gallery then PHP will be automatically enabled.

Step 2: Download the appropriate build of Xdebug extension from downloads page.
If your site uses PHP 5.2 then download “5.2 VC6 Non-thread safe (32 bit)”. If your site uses PHP 5.3 then download “5.3 VC9 Non-thread safe (32 bit)”. Use 32 bit build even if your Windows OS is 64 bit.

Step 3: Install the extension by copying the downloaded file to the following locations:

-          For PHP 5.2 on Windows 64 bit:
C:\Program Files (x86)\IIS Express\PHP\v5.2\ext\

-          For PHP 5.2 on Windows 32 bit:
C:\Program Files\IIS Express\PHP\v5.2\ext\

-          For PHP 5.3 on Windows 64 bit:
C:\Program Files (x86)\IIS Express\PHP\v5.3\ext\

-          For PHP 5.3 on Windows 32 bit:
C:\Program Files\IIS Express\PHP\v5.3\ext\

Step 4: Open the php.ini file located in the PHP installation folder, e.g.
C:\Program Files\IIS Express\PHP\v5.2\php.ini and append the following at the end (make sure that the absolute path is correct for your version of PHP and Windows.):

[xdebug] 
zend_extension = C:\Program Files\iis express\PHP\v5.2\ext\php_xdebug-2.1.0-5.2-vc6-nts.dll

Step 5: Configure PHP to display errors by changing these PHP settings in php.ini file:


display_errors = On  
error_reporting = E_ALL & ~E_NOTICE 

Step 6: Test that extension is enabled and works by either calling a phpinfo() function from a script or by running a buggy script:



The Xdebug extension provides a lot of useful features that help with debugging of PHP applications. You can learn more about them from the
Xdebug documentation. For example you can use it to profile a PHP application. Just change the php.ini file as shown below and then make a request to a PHP script:

[xdebug] 
zend_extension = C:\Program Files\iis express\PHP\v5.2\ext\php_xdebug-2.1.0-5.2-vc6-nts.dll  
xdebug.profiler_enable = On  
xdebug.profiler_output_dir = C:\Windows\temp
 

The profile log will be saved into the specified directory and will have a name cachegrind.out.* Use
WinCacheGrind to open and analyze it:



HostForLife.EU now supports Web Deploy 2.0 Hosting

clock December 15, 2011 10:24 by author Scott

HostForLIFE.EU has supported Web Deploy technique on all our hosting plans. With a web deploy technique, a customer can efficiently synchronize sites, applications or servers across your IIS 7.0 server farm by detecting differences between the source and destination content and transferring only those changes which need synchronization.

What is Web Deploy 2.0?

Web Deploy (Web Deployment Tool) simplifies the migration, management and deployment of IIS Web servers, Web applications and Web sites. Administrators can use command-line scripting with Web Deploy to synchronize IIS 6.0 and IIS 7.0 servers or to migrate an IIS 6.0 server to IIS 7.0. Web Deploy Tool also enables administrators and delegated users to use IIS Manager to deploy ASP.NET and PHP applications to an IIS 7.0 server. 


Web Deploy 2.0 Features             

·    Seamless integration with IIS 7.0 Manager and Visual Studio 2010 interface for creating packages and deploying them onto a machine, both locally and remotely

·    Seamless integration with the Web Platform Installer to install community web applications simply and easily.

·    Web application packaging

·    Web application deployment

·    Web server migration and synchronization

·    In addition to the IIS Manager and Visual Studio 10, tasks can be performed using the command-line or public APIs.



European WebMatrix Hosting :: How to Deploy WebMatrix Hosting

clock December 9, 2011 06:41 by author Scott

WebMatrix is a free tool from Microsoft that makes the task of creating, editing and publishing your website easy. It allows you to intelligently publish only the files that have changed locally, automatically configure your server for maximum compatibility, and keep your development environment in sync with the live published version of your site.

In order to build sites using WebMatrix, you'll first need to install it on your local computer or development machine.  
Click here for the download.

In order to publish sites to our servers using WebMatrix, you'll need to be sure your plan supports it. Currently all ASP.NET plans hosted on Windows 2008/IIS7 and ColdFusion 9 plans support WebMatrix.

Once you're ready to publish your site onto our live servers, you'll need to configure your Publish Settings.

1. First, be sure you're on the Site view in WebMatrix.



2. Go to the Publish drop down, under the Home tab, then select Settings.



3. From Publish Settings, select the Web Deploy protocol from the drop down (alternately, you can use FTP).

4. For Server, enter in your site's IP address.

5. For User Name, enter a valid Site User set up on your account.  If you recently ordered your site, this would be the username you set up during signup.

6. For Password, enter in the password associated with your Site Username.

7. For Site Name, enter in your domain name without the extension (e.g. .com, .net, .org, etc.), and the words "web site" after it.  For example, if your domain was "domain.com", you would enter "domain web site" in the Site Name field.  The site name is based on how your site's name is entered in IIS, and this is the naming convention we use to identify your site on the server.

8. For Destination URL, enter in the URL for the web site/application you're publishing.



9. To ensure your Web Deploy settings in WebMatrix is correct or working correctly, click Validate Connection.

WebMatrix is ready.

10. To create a Database connection, be sure your in the Databases view.

11. Under the Home tab, select New Connection.



To connect to a database, you'll need to:

1. Enter in your database name

2. The database type.

3. The server location. 

4. And then your database Login and Password.



Database Connection Strings

SQL Server Database
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

MySQL Database
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;



European WebMatrix Hosting :: Using WebMatrix and Razor to Develop ASP.NET Web Pages

clock November 18, 2011 06:54 by author Scott

Developing database-driven websites using the ASP.NET Web Pages Framework, WebMatrix and Razor is not evil as most professional ASP.NET Web Developers might think. It is hard to look back on the 90's and Classic ASP websites with much optimism as ADO, millions of include files, and spaghetti code literally became the norm. Maintaining them was an utter nightmare in most cases.

This is a different time, however, and Microsoft.Data.dll is much better than ADO, the Razor Syntax is much better than VBScript, and a lot of the security concerns around Encoding, SQL Injection, proper validation, etc. are much more well-known and publicized than it was when Classic ASP first came on the scene. At the time, we also didn't have other frameworks, like WebForms and ASP.NET MVC, and other options for data access, like LINQ To SQL and Entity Framework, so we were pretty stuck making all kinds of crazy mistakes given there wasn't another avenue for more complicated websites.

WebMatrix, the ASP.NET Web Pages Framework with Razor, and Microsoft.Data.dll fit a particular need and development environment around simple, forms-over-data websites that are nothing more than a thin layer on top of a database. Personally, at this level, anything that attempts to abstract the fact that we are just pumping data from the database onto a web page is overcomplicating the issue and making the application more difficult to maintain.

As an example, take your typical Recent News or Recent Posts page on a personal website that literally pulls data from a single table based on either a publication date or id. I see no reason to create an ASP.NET MVC or WebForms website in Visual Studio with an O/R Mapper, Visual Designer, codebehind files, view model, a bloated web.config, and other nonsense when you can just take your favorite text editor and add a few lines of Razor syntax into a page in a few minutes with a much simpler deployment model.



This is far more easier to maintain than a similar application written with ASP.NET WebForms or ASP.NET MVC. Here we have 1 file that can easily be understood in any text editor with a clear understanding that this data is coming from a database using a particular query and dumped onto a web page. Want to sort it differently? Want to display more than 20 stories? It is pretty darn clear and pretty darn easy to make those changes and any changes that fit this simple, database-driven niche.

Other than those 3 lines at the top this looks pretty close to a view in the ASP.NET MVC Framework. If things get much more complicated and you need to offer a layer of abstraction and separate out concerns, you could move those 3 lines out of the view and migrate to MVC. I suspect such an application wouldn't grow to such a need, but if it does, there is a path to a more appropriate framework.

Also noticed that by default everything is HTML Encoded with less chance for JavaScript Injection. I have to work around the framework and use an HtmlString to display the body of the post to allow raw HTML to be displayed. We didn't have automatic encoding with Classic ASP :)

Although nothing is perfect and mistakes will be made by new developers, it won't be anything like the 90's and Classic ASP. This is good stuff for simple forms-over-data websites. As professional web developers I realize we worked long and hard to learn how to properly architect complex web applications, but I think the pendulum may have swung a bit too far and we forget the joy, ease, and beauty of developing simple websites using simple techniques and simple tools.



About HostForLIFE.eu

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2016 Hosting, ASP.NET Core 2.2.1 Hosting, ASP.NET MVC 6 Hosting and SQL 2017 Hosting.


Tag cloud

Sign in