MonoDevelop 4: CSS files not loading for an ASP.NET MVC4 site

MonoDevelop 4
MonoDevelop 4

If you are like me — always living in Linux, but sometimes being required to develop ASP.NET sites — you have no doubt used MonoDevelop. While its latest iteration brings in many good things, it’s still not the ready-to-use Visual Studio.

Once you are past the System.UnauthorizedAccessException and Could not load file or assembly ‘System.Web.WebPages’ errors, you might encounter another weirdo in an imported MVC4 site, an error that prevents loading of default stylesheet(s) in browser. As a result, your site may look completely deprived of any styles, colors, images, etc.

The origin of this error lies in the simple fact that while Windows (possibly the source of your imported MVC site) is case-insensitive with file names, Linux isn’t. Correcting this is as simple as:

  1. opening the file App_Start > BundleConfig.cs, and
  2. changing
  3. bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));

    to

    bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/Site.css"));

  4. that is: site.css to Site.css

Merry coding!

Fixing the partition table: Mis-sized extended partition

This article requires the reader to have at least some basic understanding of harddisk partitions and MBR.

If you are one of the rare unfortunate blokes who have got their partition table screwed up due to a mis-sized extended partition, fret not, for there’s a very simple-to-use tool that can fix things for you. I discovered FixParts when I realized I was one of those unfortunate blokes with a messed up partition table when I was trying to install Mint 13 on my laptop. Of course, things do not go wrong without a reason. A few months back, to install Ubuntu 11.10 “Oneiric”, I did some shrinking and expanding of partitions using GParted, which must have screwed up my extended partition, making its end sector greater than the total sectors on my harddisk!

Although not a harmful scenario (damn, I didn’t even discover it until after 7 whole months!), it makes the partition table look fine and as expected in some partition managers but botched in others. As was in my case, Mint 13’s installer wasn’t able to see any partition on my disk and showed the disk as being completely blank.

A simple run of fixparts and saving the partition table to MBR fixed things for me. Silent and fast! So in case you’ve got your harddisk’s partition table not-so-heavily goofed up, FixParts is highly recommended. In case it is a more unfortunate case, TestDisk might save your day.

Enabling 3D effects in KDE 4

KDE 4 comes with it’s own set of cool 3D effects built-in, but disabled by default. In order to enjoy these effects, you need to enable them manually through the Desktop section of System Settings. But in some cases, enabling 3D can get painfully difficult, as was in my case.

3D can be enabled through one of two options – XRender and OpenGL. Effects using XRender are quite slow and inferior to what is offered by OpenGL.

Enabling 3D with XRender normally works well on almost all machines, but problems start when you try to enable 3D using OpenGL. The most common error that pops us when trying to do so is:

Failed to activate desktop effects using the given configuration options. Settings will be reverted to their previous values

Here are some simple steps to make sure you can enable OpenGL 3D effects without errors and problems.

To start with, make sure you have:

  • Proper video drivers installed (proprietary drivers in case of NVIDIA and ATI) and 3D acceleration enabled.
  • The xorg.conf file setup properly.

In most situations, these sections are usually missing from the file xorg.conf (found in /etc/X11):

Section "Files"
    ModulePath     "/usr/lib/xorg/modules/extensions/nvidia"
    ModulePath     "/usr/lib/xorg/modules/extensions"
    ModulePath     "/usr/lib/xorg/modules"
EndSection
Section "Screen"
    Option       "AddARGBGLXVisuals" "True"
EndSection

Continue reading Enabling 3D effects in KDE 4