Posts Tagged ‘linux’

.NET and MONO

Sunday, April 19th, 2009

I’ve been working on a personal project with a friend for quite a while now.  To make a long story short it deals with loading/editing/saving large quantities of public geographic data. Lately we have been throwing around the idea of having our database server’s OS in Linux instead of Windows 2000.

Which brings me to the MONO project. I’ve started testing some code I wrote in C# (a console application that accesses the Internet) by using that MS Virtual PC program I setup in my previous posting with Xubuntu. While my current goal changed a bit, I’m glad to start getting some use out of it. Basically, all I needed to do was install the mono run-time libraries and I was good to go. Now keep in mind that some Linux distributions might only have older versions of MONO available by way of a package manager (or pre-install). In this case you should see if your .NET application requires something that the available version of MONO does not have by visiting the mono project website. Otherwise you need install MONO from source (search google for a tutorial, I’ve seen at least one).

I have had one issue so far in how I wrote my application. File paths are of course difference between Windows and Linux. The issue that I’m looking into has to deal with the path separators \ and /. I currently have the program hard coded to take a path specified and append a \ between that and a filename. In linux this doesn’t work properly, so the path and filename are a bit screwed up. More specifically if I specify /home/username/Desktop, the program will save into /home/username with a filename of /Desktop-filename.ext… I’ll update this or make a new posting once I figure out how to fix that.

EDIT: This page on the mono site details about path separators.
“To write portable software, you must make sure that you use the System.IO.Path.DirectorySeparatorChar (System.IO.Path.DirectorySeparatorChar) character when you must concatenate paths, or even better, use the System.IO.Path.Combine (System.IO.Path.Combine(string,string)) method to combine pathnames.”

All that being said, I noticed on go-mono.com that they offer a VMWare file that has the latest version of MONO pre-installed on OpenSUSE Linux. I’m currently in the process of downloading the ISO and the VMWare Player and will see if it is any better than Virtual PC with Xubuntu that I’m currently using.

2nd EDIT: Started trying out VMWare and the MONO SUSE Linux image. It’s much much better than Using the MS VIrtual PC program. So I suggest you go that route if you are interested in trying something similar.

3rd EDIT: Sun VirtualBox looks like a good program to use too. It’s freely available and seems to have more features than the free VMWare does.

I’m impressed with MONO so far!

Virtualization

Friday, March 20th, 2009

I’ve been interested lately in using virtualization to setup a “computer” to do local web development on. I’m looking to configure it it closely as possible to my paid hosting, so that it will be as easy as possible when I take a project and migrate it over to to the host.

If you haven’t had any experience with virtualization, it’s basically a way of running an operating system inside whatever operating system you are currently using. The nice thing about it these days is that more recent processors have hardware extension to improve performance to the level where it’s quite usable. The software mimics all aspects of a basic computer with standard hardware. So you take your operating system install disk and go through the process as you normally would.

I am currently using Windows Vista Ultimate x64. So looking at the easiest option, I downloaded and installed Microsoft’s free “Virtual PC 2007″ program.

I’ve used it before, but don’t recall doing anything of consequence with it. It’s a simple program, but it seems quite stable and provided everything that I need.

I considered using it with my copy of say… Windows 2000, but that would be pointless as my hosting is Linux based. Seeing as while I’m coding I want to deal with paths as they would be in Linux, I’ve decided to try going that route.

I started by downloading Ubuntu server. I installed it with success, but when the OS restarted, I was greeted by some crazy looking visuals. According to various sites on the net have pointed out, Virtual PC does not support a 24-bit graphics rendering in the virtual video card, and Linux defaults to 24-bit… Seeing as the terminal was nearly unusable, I went back to unbuntu.com and downloaded Xubuntu, which is a lighter weight version that uses XFce. The only negative here is that I will have to manually install and configure the “LAMP” server. A key thing to remember when installing Xubuntu is that when it gives you options before starting the install, select F4 and change the video more to fail-safe mode.

I’ll try to provide updates as I work through the issues.





 

 
Stock Photo Website
Tech Learning Site

Popular Article Tags

Recent Article Comments

Archives