How to create a Webmatrix 2 VB.Net Site?

Most of the Webmatrix 2 site template, actually all of them are in C#.  To create a VB.Net Webmatrix 2 site just follow the steps below:

1. Create an empty site from the template


2. Once the empty site is created, delete immediately the Default.cshtml file at the Files workspace.  Then install the Bakery Template (VB) in the NuGet gallery.


3. Once installed, Webmatrix 2 will add files to your project.  Transfer those files to the root directory and delete the Microsoft Templates directory.


4. That’s it!  You can now write VB code in your Webmatrix 2 project as shown below.  But when you run the project you will get an error.



5. The cause of the error is the database object.  The database object could not be located because it resides in the class which is not installed when we created an empty site.  To solve the problem just install it using the ASP.NET Web Pages Administration in the Settings workspace.


6. That’s it!  Below is now the running site using the bakery database.


If you find this blog helpful, you can make the donation by clicking the Paypal button below.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s