The community technology preview of MVC (Model-View-Control) extensions for ASP.NET is now available for download from:
Category: ASP.NET
ASP.NET MVC With aspNETserve
I am pleased to announce that aspNETserve works with the latest CTP of MVC for ASP.NET.
aspNETserve has held up well against the MVC samples I have thrown its way, and has actually not required any code changes in aspNETserve.
Using ASP.NET MVC From Visual Web Developer Express 2008
Today marked the released of the first preview of MVC for ASP.NET. While it works just fine from the free Visual Web Developer Express 2008, this release is missing a project template to help you get up an running quickly.
A Possible Solution To The .NET 3.5/Visual Studio 2005 Feud
In my previous post I discussed a problem of developing ASP.NET 2.0 applications in Visual Studio 2005, while having the .NET 3.5 framework installed. In summation, the issue was because Visual Studio 2005 was linking against a library that shipped with .NET 3.5 instead of the explicitly referenced version from the web.config.
The comments of one reader of my previous post mentioned using binding redirection to resolve the issue. In short, it looks like they were correct. As best as I can tell, binding redirection does in fact fix this issue.
Binding redirection is the ability to take a pre-compiled application and tell the loader to link against a different version of a library than the application was originally built with. In our case, we would need to add the following configuration to our web.config.
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="2.0.0.0" newVersion="1.0.61025.0"/> </dependentAssembly> </assemblyBinding> </runtime>
Visual Studio 2005 and .NET 3.5 Don’t Play Well Together
As many of you have, I also have experimented with the pre-releases of .NET 3.5 and Visual Studio codenamed Orcas. I, for better or worse, installed this pre-release software on my primary development machine which has Visual Studio 2005.
Despite having .NET 3.5 installed on my machine, my primary development occurred in .NET 2.0 via Visual Studio 2005. I had not experienced any problems with this setup until the other day. While attempting to build and publish an ASP.NET 2.0 website with AJAX extensions, I ran into a cryptic server error when executing the site on a staging server. The error was:
Could not load file or assembly 'System.Web.Extensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
or one of its dependencies. The system cannot find the file specified.
The System.Web.Extensions assembly is the ASP.NET AJAX assembly, so at first I simply thought that the staging server did not have AJAX extensions installed. After installing the AJAX extensions, the issue remained unresolved. A quick look in the machine’s GAC showed that it had version 1.0.61025.0, which is the latest version. Inspection of my development machine’s GAC showed both 1.0.61025.0 and 2.0.0.0 installed.
At this point I was puzzled how my machine had an unofficial version of AJAX extensions, and how my website was referencing it. Next I looked at the web.config of my site to see if I could just change the referenced version to 1.0. However, inspection of the web.config reveled:
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
</add>
An Embedded ASP.NET Web Server
To correspond with the release of aspNETserve version 1.1, I have written a simple demonstration of hosting an ASP.NET 2.0 web server right into your own application.
The following code sample is about as simple as it gets.
using System; using System.Collections.Generic; using System.Text; using aspNETserve; namespace ConsoleWebServer { class Program { static void Main(string[] args) { string physicalPath = "c:\\wwwroot"; int port = 8080; using (Server s = new Server(new System.Net.IPAddress(new byte[] { 127, 0, 0, 1 }), "/", physicalPath, port)) { s.Start(); Console.WriteLine("Press any key to stop the server"); Console.ReadKey(); s.Stop(); } } } }
aspNETserve Version 1.0
Just today version 1.0 of aspNETserve was released. This version fixes all known major bugs, and represents a feature complete version in regards to aspNETserve’s original goals. Specifically this means that it can host any ASP.NET 2.0 web application without the need for Internet Information Services (IIS).
aspNETserve beta 2
The second beta of aspNETserve has just been released. Among other improvements, this version includes an automated installer to allow for easy installation.
I have only tested this on my personal machine, running Windows Vista. It should work on XP, and possibly 2000, but I have not had a chance to test those systems yet.
More Than You Ever Wanted to Know About HttpBrowserCapabilities
In ASP.NET the HttpBrowserCapabilities object easily allows you to determine which web browser your site’s visitors are using. This information is pulled from the User Agent data sent by each visitors web browser.
aspNETserve
I have just started my first project on CodePlex. The project is aspNETserve, a ASP.NET web server written entirely in C#.
The purpose of this project was mainly for me to gain a deeper understanding of ASP.NET. In the short time that I have been working on this project, my knowledge of ASP.NET has grown by leaps and bounds. I plan on writing about some of the specific things I learn while working on this project.