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

w1

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.

w2

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

w3

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.

w4

w5

5. The cause of the error is the database object.  The database object could not be located because it resides in the Webmatrix.data 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.

w6

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

w7

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

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

w

Connecting to %s