.cfm to .aspx mapping no longer works after upg to .Net2.0 - GLT10

20-Oct-06 03:33:01
Hi,

We have a web application that contains a legacy page
with the .cfm file extension. The page contains an inline
.Net c# script. We have an application configuration
mapping in IIS that maps the .cfm extension to the .Net
ISAPI:
c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll

We have a httphandler set up in the web.config file thus:


Under .Net1.1 this worked allowing the .Net script within
the .cfm file to be executed. Under.Net2.0, the file is found,
but nothing other than a http 200 status is returned. The
debug trace registers the fact that IIS found the .cfm file,
but the "Trace Information", "Control Tree", "Session State"
and "Application state" sections are all empty.

It is as though the .Net2.0 engine ignores the file contents
completely. What's going on here? Why isn't the script
executed?

Cheers,
Geoff
reply
 
 

.cfm to .aspx mapping no longer works after upg to .Net2.0 - David Wang

21-Oct-06 06:06:19
This is really an ASP.Net question, so I suggest asking in ASP.Net
Forums at www.asp.net.

As you stated, IIS handed the .cfm resource to aspnet_isapi.dll for
processing, which means this really is not an IIS issue.

I suggest you copy .aspx Application Mapping definition in IIS and
ASP.Net httpHandlerdefinition exactly, except for switching .cfm for
.aspx, and the behavior should be the same. Unless you have other
custom software running on the server that is behaving differently for
.cfm extension vs .aspx extension. I don't know what custom software
like ISAPI Filter, ISAPI Extension, or ASP.Net httpModule you may be
running, so I cannot comment further


//David
http://w3-4u.blogspot.com
//
reply
 

.cfm to .aspx mapping no longer works after upg to .Net2.0 - GLT10

24-Oct-06 02:53:02
Hi David,

Thanks for the response. I tried asking on asp.net. No reponse since Friday
yet.

I still suspect an issue related to IIS since this worked before we upgraded
to .Net 2.0.

To address the points you raised:
copy .aspx Application Mapping definition in IIS and ASP.Net
httpHandlerdefinition exactly, except for switching .cfm for ..aspx. This is
exactly what I did originally.

There is no other ISAPI filter or exteniosn that will handle .cfm files.
An old incarnation of the site on different hardware was a ColdFusion
site, but that was long ago on different hardware.

I forgot to include:
IIS6.0 on
Windows Server 2003 SP1 with SQL Server 2000

Cheers,
Geoff
reply
 

.cfm to .aspx mapping no longer works after upg to .Net2.0 - David Wang

24-Oct-06 06:56:42
Can you please make sure that your .cfm httpHandler definition is
located right after the .aspx httpHandler definition in the web.config
file. In general, on ASP.Net 2.0, you want your defined httpHandler to
be *before* any other httpHandler using/deriving-from the
DefaultHttpHandler. If you do not do this, you will most likely observe
different behavior between ASP.Net 1.x and 2.0 on IIS 6.0, and that is
by-design.

Yes, this incongruous behavior can be confusing and different from
prior ASP.Net behavior, and explaining will require more background
understanding of both IIS and ASP.Net request pipeline. IIS7 will
attempt to rationalize all of this.

Let me clarify that ASP.Net and .Net Framework are completely separate
products from IIS. The sequence of events that happen during request
processing goes from IIS to ASP.Net to .Net Framework, then back out
through ASP.Net and then IIS.

So when you say that you see this issue after upgrading to .Net
Framework 2.0 and your trace says that .cfm request got into .Net, you
basically invalidate your suspicion that the issue is related to IIS.
Your statement tells me that IIS is NOT involved. Not to mention all
the problems that you see are within ASP.Net constructs unrelated to
IIS.

Now, you said that your .cfm httpHandler/ApplicationMapping now returns
HTTP status 200 -- is that what the browser claims it got, what the
server actually logged into its log file (please provide the exact log
entry from the log file), or something else that you interpreted.


//David
http://w3-4u.blogspot.com
//
reply
 

.cfm to .aspx mapping no longer works after upg to .Net2.0 - GLT10

25-Oct-06 12:23:02
Hi David,

Thanks for the clarification.
Answers to your questions:
1) You said:
located right after the .aspx httpHandler definition in the web.config
file."

There is only one httphandler definition in the web config file:
So order/derivation should not be an issue should it?

2) You said:
server actually logged into its log file (please provide the exact log
entry from the log file)"

That is the status I see returned "on the wire" using the packet sniffer
Ethereal. Here is the associated entry in the IIS Log:
2006-10-25 15:59:35 10.10.10.19 GET /www/downloads/demo/upload_action.cfm -
80 - 10.10.10.63 Opera/9.02+(Windows+NT+5.0;+U;+en) 200 0 0

I am now repeating the set up on clean hardware so that I can
write steps to reproduce the behaviour. I think that's the only
way we'll figure out what's wrong here.

Thanks again for the help!
Geoff.



Cheers,
Geoff.
reply
 

.cfm to .aspx mapping no longer works after upg to .Net2.0 - GLT10

25-Oct-06 01:19:02
At last I found it!

In building the steps to reproduce the error on clean hardware,
when I switched the test site to .Net2.0 I got the error:
register one in the <compilation><buildProviders> section in machine.config
or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute
which includes the value 'Web' or 'All'."

I added the lines:
type="System.Web.Compilation.PageBuildProvider" />
to the web.config file and now the script executes. I have never seen
this mentioned anywhere as a requirement for allowing a file extension
mapping to work.

Also adding the attribute "BuildProviderAppliesToAttribute"
causes an Unrecognized attribute error. No idea what's up with that.

Cheers,
Geoff
reply
 

.cfm to .aspx mapping no longer works after upg to .Net2.0 - David Wang

25-Oct-06 02:23:16
Glad you found a solution.


Not correct. Collections (the ones with a list of values, such as
httpHandlers, httpModules, even buildProviders) are item lists whose
ordering and effective value depend on where it merges into the entire
web.config hierarchy. In other words, the above definition simply says
do not see it, there are at least two other .config higher in the
hierarchy which provide values for httpHandlers.

So, all you have done is to append a new httpHandler for the
application that your web.config applies to.

If you wanted to make sure that httpHandlers applicable at that scope
contains ONLY your new httpHandler, you'd use:

/>


However, you'd probably find other things that break when you do
this...

In other words, when you are tweaking these values, you need to know
the exact net-effect of what you are doing.



Well, I'm wager that maybe it is because not many people execute
ASP.Net code using another file extension - they'd just use .aspx,
which is pre-configured and working... so, you're probably doing
something that few people do, and those that do, know about
BuildProviders because they are writing custom ones.

When it comes to modifying httpModules and httpHandlers, I would not
assume that the same syntax provides the same behavior from version to
version. For example, it all changes once again in IIS7 for other good
reasons. So, for any given httpHandler/httpModule collection, it could
have different behaviors on ASP.Net 1.0/1.1, ASP.Net 2.0, and IIS7.


//David
http://w3-4u.blogspot.com
//
reply
 

.cfm to .aspx mapping no longer works after upg to .Net2.0 - GLT10

25-Oct-06 02:37:01
Thanks again David.

That's a good "Heads-up" about IIS 7. I guess I can expect
similar problems when we move up to that. Do you have a
link to some information on IIS7? I have not seen much
about that yet.

Cheers,
Geoff.
reply
 

.cfm to .aspx mapping no longer works after upg to .Net2.0 - Bernard Cheah [MVP]

25-Oct-06 10:45:15
www.iis.net

--
Regards,
Bernard Cheah
http://www.iis.net/
http://www.iis-resources.com/
http://msmvps.com/blogs/bernard/
reply
 
Server.CreateObject suddenly start failing
promotion
Silverlight    WPF    WCF    WWF    LINQ   
JavaScript    AJAX    ASP.NET    XAML   
C#    VB.NET    VB 6.0    GDI+    IIS    XML   
.NET Generics    Anonymous Methods    Delegate   
Visual Studio .NET    Expression Blend    Virus   
Windows Vista    Windows XP    Windows Update   
Windows 2003 Server    Windows 2008 Server   
SQL Server    Microsoft Excel    Microsoft Word   
SharePoint    BizTalk    Virtual Earth   
.NET Compact Framework    Web Service   

"Everything" RSS / ATOM Feed Parser
How to send and receive messages through message queuing in .Net
How to Read text file as database
SQL Server 2005 Paging Performance Tip
Display code of web page.
Fully Scalable Excel File Importer class for .net using Microsoft Jet driver
Generic Chart Color Manager class that can be used for any charts
Helper class to style the infragistics wingrid
Using Reflection to detemine as Assembly Info in and out.
Helper class to play with Window (Owners and position)
Resolving displayname from the culture using the XmlLanguage and LanguageSpecificStringDictionary class