Zhixian's Tech Blog

2015-01-10

Can not load type MembershipPasswordAttribute using ASP.NET (Mono)

Filed under: web application development — Tags: , , , — Zhixian @ 08:33:01 am

Note: This blog post does not provide a solution.

Background

Recently, I was trying to build a ASP.NET MVC project using Mono on my Ubuntu machine.
It did not end well.

While building the login page, I got this error message.

Could not load type ‘System.Web.Security.MembershipPasswordAttribute’ from assembly ‘System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’.

Error 500 - Google Chrome_201

The offending code is:

test.mvc.web - Views-Home-Index.cshtml - MonoDevelop_202

As it turns PasswordFor is not the only helper extension that will trigger this error.
TextBoxFor have the same issue as well.

Why this happens

As it turns out, the Mono 4.5 that I am using at this time of writing does not have this implemented yet.

You can view here (http://go-mono.com/status/status.aspx?reference=4.5&profile=4.5&assembly=System.Web).

Mono System.Web in 4.5 vs MS.NET 4.5 - Google Chrome_203

Solution

No good solution to this issue currently.

One possible workaround is not to use the HTML Helper extensions.

Advertisements

2015-01-05

Install nunit on Ubuntu

Filed under: computing — Tags: , , — Zhixian @ 23:34:01 pm

To install nunit on Ubuntu, start a terminal session and execute the following command:

sudo apt-get install nunit nunit-console nunit-gui

zhixian@SARA: ~_200

After installation has complete, you can run nunit by executing the following command in the terminal session:

nunit-gui

for the user-friendly graphical interface or alternatively,

nunit-console

for the nunit console.

2015-01-04

How to install xsp4 onto Ubuntu

Filed under: computing — Tags: , , — Zhixian @ 09:14:01 am

I just realise that the mono-complete does not include the xsp4 package.
This package is needed if you intend to debug web applications using MonoDevelop.

sudo apt-get install mono-xsp4

zhixian@SARA: ~_196

After the installation process has complete, you may see a message stating that you have an incomplete debian.webapp.

zhixian@SARA: ~_199

To remedy this, install asp.net-examples by running the below command:

sudo apt-get install asp.net-examples

zhixian@SARA: ~_198

2015-01-03

Installing Postgresql using installer from EnterpriseDB on Ubuntu

Filed under: computing — Tags: , , , , , , , — Zhixian @ 17:23:01 pm

This blog post describes installing Postgresql 9.4 and pgAdmin III 1.20.0 using the installer provided by EnterpriseDB.

Background (Or lessons learnt)

I recently installed a copy of Postgresql on Ubuntu based on instructions from the official web site (http://www.postgresql.org/download/linux/ubuntu/).
Unfortunately, the copy of pgAdmin III (a graphical UI to manage Postgresql databases) is outdated.
The version of Postgresql installed was 9.4 but the version of pgAdmin installed was 1.18.1 which has warnings issued when I connect to the database.

pgAdmin III_168

So I decide to do the next best thing mentioned in the page – use the installer from EnterpriseDB in hopes that they have packaged the latest copy of pgAdmin III.

PostgreSQL: Linux downloads (Ubuntu) - Google Chrome_171

Assumptions

I assumed you know how to start a terminal session and execute commands in it.

Summary of Steps

  1. Download Installer
  2. Making Installer executable
  3. Execute the Installer

Download Installer

Clicking the download link in the previous screen shot will bring me to the EnterpriseDB’s Postgresql install download page (http://www.enterprisedb.com/products-services-training/pgdownload).

Because I’m running the 64-bit version of Ubuntu, I clicked on the “Linux x86-64” button to download the installer.

Download PostgreSQL | EnterpriseDB - Google Chrome_172

After you clicked the button, you will be brought to a thank-you page.
Wait for the download to complete.

Thank you for downloading PostgreSQL! | EnterpriseDB - Google Chrome_173

After the download has complete, your download folder should look like the below.

Downloads_174

Making Installer executable

By default, the downloaded file is not executable by double-clicking it.
Attempts to do so, will result in the below dialog:

Untitled window_175

Click on the No button to close the dialog.

To make the downloaded file executable:

1. Start a terminal session and navigate to folder where you saved the downloaded installer.

zhixian@SARA: ~-Downloads_176

2. Run the following command. Replace the text in bold if necessary if you are not using Ubuntu 64-bit.

chmod +x ./postgresql-9.4.0-1-linux-x64.run

zhixian@SARA: ~-Downloads_177

Execute the installer

Now you can execute the installer. From the terminal session, run the following command start the installation wizard:

sudo ./postgresql-9.4.0-1-linux-x64.run

zhixian@SARA: ~-Downloads_180

You will see the welcome screen of the installation wizard.
Click on Next button to proceed to the next step of the installation wizard.

Setup (as superuser)_181

The installation wizard should prompt you for the location to install Postgresql.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Setup (as superuser)_182

The installation wizard will now prompt you for the directory to store data for Postgresql.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Setup (as superuser)_183

The installation wizard will now prompt you for a password to the postgres account.
This account is use for starting Postgresql.
Enter your desired password for this account.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Setup (as superuser)_184

The installation process will then prompt you for a port number that Postgresql will use to host the database server.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Note The default port that Postgresql use is 5432. However, this port is all in used by the first instance of Postgresql that I installed previously the installation wizard picked the next available port 5433. I accepted the defaults in the screen shot below planning to uninstall the first instance of Postgres and then reconfigure this instance of Postgresql to use port 5432.

Setup (as superuser)_185

The installation wizard will now prompt you for the locale that your database will use.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Setup (as superuser)_186

The installation will now declare that it has all the information need to install Postgresql.
Click on Next button to accept the default and proceed with installing Postgresql.

Setup (as superuser)_187

The installation wizard will start to install Postgresql.
Wait for the installation process to complete.

Setup (as superuser)_188

After the installation process has complete, you will see the below screen.
Click on Finish button to exit the installer.

Note If you not need to download and install additional software, uncheck the option to start Stack Builder at exit.

Setup (as superuser)_189

After you exit the installation wizard, you should be able to see the Postgresql that you just installed from the desktop menu.

Workspace 1_195

Note If you do not see the menu item, you may need to re-login or restart your system.

The pgadmin installed should be version 1.20 and should work fine with Postgresql 9.4.

Create a free website or blog at WordPress.com.