I somehow missed this one, but just yesterday ASP.NET MVC made it to Beta status. Justifying its own download page on the MSDN. I haven’t had a chance to read the release notes to see what all is new, as I am currently in process of uninstall Preview 5 to make way for this new release.
Year: 2008
A Generic Error Occurred in GDI+
You know you’re doing good when your application crashes with an exception as detailed as “a generic error occurred in gdi+”. That is about as, well generic, as it gets :- )
In my particular case I was constructing an Image down in my DAO using the FromStream method, like so:
Image result; using (FileStream file = File.OpenRead(filename)) { result = Image.FromStream(file); file.Close(); } return result;
I was doing this so that I could know for a fact that the file was being disposed of properly. I didn’t want to have any orphaned file references locking up the file in case I later needed to delete it.
The problem was that up in my UI I was attempting to call the Save method on Image to dump its contents out to the ASP.NET response stream, like so:
img.Save(HttpContext.Response.OutputStream, ImageFormat.Jpeg);
Silverlight Progress Bar
Silverlight 2 provides an attractive platform for creating Rich Internet Applications, however when first getting started both the oddities of the layout model and the strange absence of certain controls and class and be puzzling.
One such puzzling absence from the Silverlight tool chest is a progress bar control. WPF has a progress bar, WinForms has a progress bar, but not Silverlight. Fortunately implementing one is not that hard and provided a great introduction to Silverlight’s layout model.
Silverlight and layers
Unlike ASP.NET, and many other forms technologies, Silverlight uses a multiple layer positioning system. The Canvas control is especially useful for allowing multiple controls to be layered.
Take for example this simple block of XAML:
<Canvas x:Name="LayoutRoot" Background="WhiteSmoke"> <Rectangle Width="60" Height="60" Fill="Green" /> <Rectangle Width="60" Height="60" Fill="Gray" /> <Rectangle Width="60" Height="60" Fill="LightBlue" /> </Canvas>
Silverlight MessageBox
Silverlight oddly enough lacks a MessageBox class. Fortunately Silverlight’s HTML Bridge exposes the JavaScript Alert method, which is functionally the same thing.
Vista Can’t Read CDs
I recently encountered a strange problem on my Vista (Home Premium x64) machine, in which Vista seemingly forgot how to read CDs. I would place a factory printed CD in my DVD-RW drive and Windows reacted as if it was a blank DVD-RW by asking me to supply a volume name.
Hyper-V Server: First Impressions
Microsoft’s latest offering, Hyper-V Server, is a special edition of Windows Server 2008 in Server Core mode whose only available role is Hyper-V. While this itself is nothing to write home about, the kicker is that its free! Microsoft has decided to release Hyper-V Server as a free product, no registration or activation needed.
Community Coding Contest
Developing an open source project is a very rewarding experience. But sadly (as an open source developer that is) open source projects rarely get the feedback they deserve. Often the developers only hear feedback from their users when their software is broken, because of this it is often difficult to know when an author’s work is truly appreciated.
Point Release
Just a quick update, a new version of aspNETserve has been release. Version 1.3.1 represents a point release containing general bug fixes, and is recommended for all users.
aspNETserve Without GAC Install
The topic has come up many times, and that is “Why do I have to register aspNETserve.Core.dll in the GAC to run aspNETserve?”. The answer to this question has to do with how aspNETserve uses the ASP.NET hosting facilities, so first some background information.
aspNETserve 1.3: What’s New
As I mentioned in my last post, aspNETserve 1.3 has just been released. And with it comes some exciting changes. Here is an outline of some of the most notable changes:
aspNETserve’s goal is to target version 1.1 of the HTTP protocol, and prior to version 1.3 of aspNETserve it had an obvious shortcoming in that goal. It did not even attempt to keep “Keep-Alive” (aka, persistent) connections around. The server naively closed the connection after each request.
The new aspNETserve.Server object in version 1.3 has full support for persistent connections, and with it introduces a couple of new properties:
MaxConnections
This property represents the maximum number of simultaneous connections allowed. Once the maximum amount has been reached additional requests will be declined.
KeepAliveRequestTimeout
A period of time (in milliseconds) that aspNETserve will wait for subsequent communications on a previously established connection.
A Windows service called aspNETserve.Ice (pun intended) allows aspNETserve to process requests in the background. Additionally, this allows request processing without a user having to first login and launch the SimpleServer UI.
aspNETserve.Ice reads it configuration from an XML file whose schema is define on the wiki page ConfigSchemaOverview.
Here is a simple example of what the XML file looks like:
<?xml version="1.0" encoding="utf-8"?>
<server xmlns="http://aspnetserve.googlecode.com/svn/tags/Release%201.3/aspNETserve/Configuration/Xml/aspNETserve.config.xsd">
<application physicalPath="c:\temp">
<domain name="www.example.com" virtualPath="/" />
<endpoint ip="127.0.0.1" port="80" />
<endpoint ip="127.0.0.1" port="443" secure="true" />
</application>
</server>