How to make Visual Studio 2005 to handle .asp files like .aspx

  • Thread starter Thread starter Faustino Dina
  • Start date Start date
F

Faustino Dina

Hi all,

I'm porting some old ASP code to ASP.NET. The problem I need to service a
request to an x.asp script that was originally developed in ASP VBScript
code. I need the new C# ASP.NET code to be inside x.asp. And I need this to
be debugged from Visual Studio 2005.
To do that I followed http://support.microsoft.com/kb/815172 to configure
IIS to map .asp to be processed by using .NET dll, and also modified the
web.config in my Visual Studio 2005 project by adding

<httpHandlers>
<add verb="GET, HEAD, POST, DEBUG" path="*.asp"
type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>
But now on the x.asp script:

<%
//'dim id
//'session.Contents.RemoveAll()
Response.AddHeader("Pragma", "no-cache");
Response.AddHeader("cache-control","private");
Response.CacheControl = "no-cache";
session("giro")=Request.QueryString("gr");
response.write("&giro="&session("giro"));
%>

When it is called from the client, the iis server logs an 500 error. I put a
breakpoint in the code but it is not honored. Even I can not get a
compilation error from this file. I think Visual Studio does not recognizes
the association made in iis that .asp is now an alias of .aspx

What should I do work with the .asp files like .aspx in Visual Studio 2005?

Any hint is welcomed

Thanks in advance

Sammy
 
Well, from this source
(http://dotnetlog.com/archive/2007/10/15/using-non-asp.net-file-extensions-with-asp.net.aspx)
I borrowed a few new lines for the web.config.
<buildProviders>

<add extension=".asp" type="System.Web.Compilation.PageBuildProvider"/>

</buildProviders>



This should be put inside <compilation > tag.



Now, when I run the project from inside VS, I receive compilation errors...
in the Event Viewer! At least it is a step forward. VS continues to ignore
the .asp source code despite I registered extension .asp to use C# in
Tools - Options - Text Editor - File Extension .



What am I missing?

Thanks in advance

Sammy
 
Back
Top