My Monday morning WTF comes from IIS7 on Windows 7. I recently installed Coldfusion9 on this machine which has a handful of existing ASP.NET 3.5 web applications. The problem I ran into came after installing Coldfusion9 and electing to configure all IIS websites to work with CF. While that is convenient, it ended up breaking one of my ASP.NET applications that was using ASP Validation controls on a login form. Now that things are figured out, here are the details.
Firing up my ASP.NET application gives me the error message :
The WebResource.axd handler must be registered in the configuration to process this request

WebResource.axd handler must be registered
Obviously all I could think is WTF?!?!? since this application worked on Friday and now it is broken. The first thing I want to point out is that in my situation, the suggested solution of mapping WebResource.axd in the httpHandlers section of my web.config did not help this problem. After some googling I cam across this post on the IIS.NET forums which put me on the right track. You can read the details there if you want a good background on MS’ response and other users running CF and ASP.NET on the same box.
I’m happy to say I have three workarounds for this issue. Hopefully these will help you as well.
1. Change your AppPool to run in Classic Mode
- In inetmgr, put your web application into it’s own Application Pool ( unless it’s already in it’s own pool )
- Change that AppPool’s Managed pipeline mode to “Classic”
- You should be good to go

Classic mode is for compatibility ( think IIS6 )
2. Stop using ASP Validation controls
All ASP.NET Validation controls are hosted by WebResource.axd. If you stop using ASP Validator controls, the server will stop asking for WebResource.axd.

Removing ASP Validator controls should remove this error
3. Remove Coldfusion handler mappings from your ASP.NET site
If your ASP.NET app isn’t using Coldfusion, I would suggest doing this as your solution. Even if you do need Coldfusion in your ASP.NET app, you could still host your CF app in it’s own Virtual Directory and request if via ASP.NET.
- Open inetmgr
- Select your web app on the left ( under Default Web Site )
- In Features View on the right, double click Handler Mappings
- Sort your Handler Mappings by Name, and remove all entries titled “AboMapperCustom-*”
- Now your ASP.NET should work like a champ.

IIS7 Handler Mappings

Coldfusion9 Handler Mappings
Monday WTF solved. Now to get back to pushing buttons.
Tags: asp.net, coldfusion, iis7, inetmgr, web.config, webresource.axd
Posted in .net, adobe, coldfusion, development, microsoft, tips and tricks, windows | No Comments »
Wanted to share this since it gave me so much trouble figuring out. It’s a simple SQL query ported to LINQ to SQL that joins two tables to return a filtered listed of data.
Here are the tables from my schema

Here is a basic SQL statement I could fire to retrieve my user videos.
select *
from video v, user_videos uv
where v.vid = uv.vid
and uv.uid = 2

Here is how you would run the same query using .net’s LINQ to SQL.
// create DB connection
var db = new DBCONN();
// run query
List<video> uvids = (
from c in db.video
join o in db.user_videos
on c.vid equals o.vid
where o.uid == 2
select c
).ToList();
This query differs slightly from the screenshot below because I used it in a WCF Service.

The variable DBCONN is my database connection that I established when mapping my DB. If you are not familiar with how to set this up, use the Visual Studio’s “Add the ADO.NET Entity Data Model” wizard. With your .net project open, right click your project, left click on “Add the ADO.NET Entity Data Model”. This wizard will walk you through setting up everything you need to setup your DB model file ( edmx ), as well as setting up your database connection and saving it in web.config.
Jesse Liberty did a simple tutorial that uses this wizard in a WCF service application.
I hope this helps somebody out.
Tags: asp.net, join, linq, linq to sql, linqtosql, query, sql
Posted in .net, C#, database, development, microsoft, sql, tips and tricks | No Comments »
I love C#, but miss the simplicity of PHP sometimes. Specifically when dealing with collections. Recently I ran into a situation where PHP’s implode would have been perfect, but I wasn’t able to find any quick and easy built in solution.
I would like to be able to do this
string id_list = implode( ",", mySortedList.Keys );
I’m not aware of any built in ways to do this, so I wrote the following helper function.
///
/// Pass in a SortedList and this will return a string containing a delimited
/// list of keys separated by delim
///
///
///
/// key1{DELIM}key2{DELIM}keyN
public static string SortedListKeysToDelimList(SortedList sl, string delim)
{
StringBuilder sb_keys = new StringBuilder();
foreach (DictionaryEntry dl in sl)
{
sb_keys.Append( dl.Key.ToString() );
// append DELIM only if we're NOT on the last entry
if (dl.Key != sl.GetKey(sl.Keys.Count - 1))
{
sb_keys.Append( delim );
}
}
return sb_keys.ToString();
}
If there is any better way to do this, please leave me a comment.
Tags: asp.net, C#, implode, php, SortedList
Posted in .net, C#, php | 4 Comments »
I came across a new server message today – “The test form is only available for methods with primitive types or arrays of primitive types as parameters”
While working with flash and asp.net web services I learned that you can send a custom class object to an ASMX. That service can then take your object and have it’s way with it. This is pretty killer because you can share custom classes between .net and as, assuming the class definitions match, and the datatypes don’t get too complex.
If you have to work with webservices from flash, checkout the WebService class. It’s sweet. So much so that I don’t understand why I even need Flash Remoting. I mean, I can send and receive my custom class on the flash side as well as the .net side.
Currently I only see the following limitations with this magic flash to soap communicado.
- No test form on the .asmx page. For a typical asmx file, the .net server can generate a simple test form that you can use to test your webservice. It’s great, except for a service that expects your custom class as input
- Simple data types. I haven’t tested the waters of what datatypes you can use in your custom object, but I’m guessing you can’t venture outside of the basic strings and numbers.
I’m pretty pumped about learning the AS WebService class. It’s so much nicer than the olden days of parsing name value pairs, or even a full on xml object. The WebService class does all the magic for you in flash, and you code up the result object as you’ve defined your custom object.
end of line
Tags: asmx, asp.net, custom class, flash, flash remoting, web services
Posted in .net, C#, flash, microsoft | No Comments »