472,988 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,988 software developers and data experts.

What is the assembly name to use for new ASHX files

I am trying to add a Generic Handler (ASHX) to my web site solution. In
order to do that I have to specifiy an assembly name in the web.config file.
But since 2.0 web sites are no longer pre-compiled I get an error when
trying to load the first page.

<system.web>
<httpHandlers>

<add verb="GET,POST" path="*.angel" type="Namespace.MyHandler" />

</httpHandlers>

</system.web>

I get the following error:

Line 51: <system.web>
Line 52: <httpHandlers>
Line 53: <add verb="GET,POST" path="*.angel"
type="Namespace.MyHandler" />
Line 54: </httpHandlers>
Line 55: </system.web>

- Philipp
Nov 19 '05 #1
6 2737
What is the error ?

You did not include it.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Philipp Schmid [MSFT]" <ph*****@microsoft.com> wrote in message
news:uP****************@TK2MSFTNGP09.phx.gbl...
I am trying to add a Generic Handler (ASHX) to my web site solution. In order to do that
I have to specifiy an assembly name in the web.config file. But since 2.0 web sites are
no longer pre-compiled I get an error when trying to load the first page.

<system.web>
<httpHandlers>

<add verb="GET,POST" path="*.angel" type="Namespace.MyHandler" />

</httpHandlers>

</system.web>

I get the following error:

Line 51: <system.web>
Line 52: <httpHandlers>
Line 53: <add verb="GET,POST" path="*.angel" type="Namespace.MyHandler" />
Line 54: </httpHandlers>
Line 55: </system.web>

- Philipp

Nov 19 '05 #2
Sorry about that:

Parser Error Message: The 'type' attribute must be set to a valid Type name
(format: <typename>[,<assemblyname>])

- Philipp

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
What is the error ?

You did not include it.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Philipp Schmid [MSFT]" <ph*****@microsoft.com> wrote in message
news:uP****************@TK2MSFTNGP09.phx.gbl...
I am trying to add a Generic Handler (ASHX) to my web site solution. In
order to do that I have to specifiy an assembly name in the web.config
file. But since 2.0 web sites are no longer pre-compiled I get an error
when trying to load the first page.

<system.web>
<httpHandlers>

<add verb="GET,POST" path="*.angel" type="Namespace.MyHandler" />

</httpHandlers>

</system.web>

I get the following error:

Line 51: <system.web>
Line 52: <httpHandlers>
Line 53: <add verb="GET,POST" path="*.angel"
type="Namespace.MyHandler" />
Line 54: </httpHandlers>
Line 55: </system.web>

- Philipp


Nov 19 '05 #3
I've also tried to create another class library (HandlerLib) project that
contains the ASHX file and then reference that assembly from my web site
project (which promptly adds HandlerLib.dll to the Bin directory). When I
then use the assembly name HandlerLib in my web.config file it still doesn't
work. Maybe I need to put it in the GAC?

- Philipp

BTW, I am using VS.NET 2005 B2 in case that makes any difference.

"Philipp Schmid" <ph*****@microsoft.com> wrote in message
news:Oh**************@TK2MSFTNGP09.phx.gbl...
Sorry about that:

Parser Error Message: The 'type' attribute must be set to a valid Type
name (format: <typename>[,<assemblyname>])

- Philipp

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
What is the error ?

You did not include it.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Philipp Schmid [MSFT]" <ph*****@microsoft.com> wrote in message
news:uP****************@TK2MSFTNGP09.phx.gbl...
I am trying to add a Generic Handler (ASHX) to my web site solution. In
order to do that I have to specifiy an assembly name in the web.config
file. But since 2.0 web sites are no longer pre-compiled I get an error
when trying to load the first page.

<system.web>
<httpHandlers>

<add verb="GET,POST" path="*.angel" type="Namespace.MyHandler" />

</httpHandlers>

</system.web>

I get the following error:

Line 51: <system.web>
Line 52: <httpHandlers>
Line 53: <add verb="GET,POST" path="*.angel"
type="Namespace.MyHandler" />
Line 54: </httpHandlers>
Line 55: </system.web>

- Philipp



Nov 19 '05 #4
Hi, Philipp.

If all you want to do is add a specific extension
to the pages which are served by your server, use this :

<httpHandlers>
<add verb="GET, HEAD, POST, DEBUG" path="*.angel"
type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>
<compilation>
<buildProviders>
<add extension=".angel" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>

and map the extension .angel to aspnet_isapi.dll in the
Application's configuration section in the Internet Service Manager.

That will cause ASP.NET to process the .angel extension
in the exact same way it processes files with the .aspx extension.

That should be enough for your needs.

If it isn't, post what you want to do with your .angel extension,
that can't be done in an aspx file.

See my custom extension .juan running at : http://asp.net.do/test/version.juan


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Philipp Schmid" <ph*****@microsoft.com> wrote in message
news:ev**************@tk2msftngp13.phx.gbl...
I've also tried to create another class library (HandlerLib) project that contains the
ASHX file and then reference that assembly from my web site project (which promptly adds
HandlerLib.dll to the Bin directory). When I then use the assembly name HandlerLib in my
web.config file it still doesn't work. Maybe I need to put it in the GAC?

- Philipp

BTW, I am using VS.NET 2005 B2 in case that makes any difference.

"Philipp Schmid" <ph*****@microsoft.com> wrote in message
news:Oh**************@TK2MSFTNGP09.phx.gbl...
Sorry about that:

Parser Error Message: The 'type' attribute must be set to a valid Type name (format:
<typename>[,<assemblyname>])

- Philipp

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
What is the error ?

You did not include it.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Philipp Schmid [MSFT]" <ph*****@microsoft.com> wrote in message
news:uP****************@TK2MSFTNGP09.phx.gbl...
I am trying to add a Generic Handler (ASHX) to my web site solution. In order to do
that I have to specifiy an assembly name in the web.config file. But since 2.0 web
sites are no longer pre-compiled I get an error when trying to load the first page.

<system.web>
<httpHandlers>

<add verb="GET,POST" path="*.angel" type="Namespace.MyHandler" />

</httpHandlers>

</system.web>

I get the following error:

Line 51: <system.web>
Line 52: <httpHandlers>
Line 53: <add verb="GET,POST" path="*.angel" type="Namespace.MyHandler"
/>
Line 54: </httpHandlers>
Line 55: </system.web>

- Philipp



Nov 19 '05 #5
Using an ASPX page was my first attempt. However, I haven't found a way to
remove the <htm>, <head>, and <body> tags from the response that is
generated! Well, guess what - I tried again and now it works!

So my immediate problem is solved, but I still wonder how to add an ASHX
handler to a 2.0 web site. I think having an second assembly which contains
the handler code is probably correct. Now why it doesn't get loaded then
added as a reference to the project (and is put in the \bin directory) is
strange to me. Does this assembly have to be signed (but then the error
message could be improved).

- Philipp
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:OO**************@TK2MSFTNGP10.phx.gbl...
Hi, Philipp.

If all you want to do is add a specific extension
to the pages which are served by your server, use this :

<httpHandlers>
<add verb="GET, HEAD, POST, DEBUG" path="*.angel"
type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>
<compilation>
<buildProviders>
<add extension=".angel" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>

and map the extension .angel to aspnet_isapi.dll in the
Application's configuration section in the Internet Service Manager.

That will cause ASP.NET to process the .angel extension
in the exact same way it processes files with the .aspx extension.

That should be enough for your needs.

If it isn't, post what you want to do with your .angel extension,
that can't be done in an aspx file.

See my custom extension .juan running at :
http://asp.net.do/test/version.juan


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Philipp Schmid" <ph*****@microsoft.com> wrote in message
news:ev**************@tk2msftngp13.phx.gbl...
I've also tried to create another class library (HandlerLib) project that
contains the ASHX file and then reference that assembly from my web site
project (which promptly adds HandlerLib.dll to the Bin directory). When I
then use the assembly name HandlerLib in my web.config file it still
doesn't work. Maybe I need to put it in the GAC?

- Philipp

BTW, I am using VS.NET 2005 B2 in case that makes any difference.

"Philipp Schmid" <ph*****@microsoft.com> wrote in message
news:Oh**************@TK2MSFTNGP09.phx.gbl...
Sorry about that:

Parser Error Message: The 'type' attribute must be set to a valid Type
name (format: <typename>[,<assemblyname>])

- Philipp

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
What is the error ?

You did not include it.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Philipp Schmid [MSFT]" <ph*****@microsoft.com> wrote in message
news:uP****************@TK2MSFTNGP09.phx.gbl...
>I am trying to add a Generic Handler (ASHX) to my web site solution. In
>order to do that I have to specifiy an assembly name in the web.config
>file. But since 2.0 web sites are no longer pre-compiled I get an error
>when trying to load the first page.
>
> <system.web>
> <httpHandlers>
>
> <add verb="GET,POST" path="*.angel" type="Namespace.MyHandler" />
>
> </httpHandlers>
>
> </system.web>
>
> I get the following error:
>
> Line 51: <system.web>
> Line 52: <httpHandlers>
> Line 53: <add verb="GET,POST" path="*.angel"
> type="Namespace.MyHandler" />
> Line 54: </httpHandlers>
> Line 55: </system.web>
>
> - Philipp
>
>



Nov 19 '05 #6
Hi, Philipp.

have you seen an article by Scott Mitchell,
titled "Serving Dynamic Content with HTTP Handlers" ?

It's at :
http://msdn.microsoft.com/library/de.../httphandl.asp
and has quite extensive sample code at :
http://download.microsoft.com/downlo...s.msiAnalyzing Scott's sample code might help you dissectwhy yours isn't working the way you'd like it to work.Juan T. Llibre, ASP.NET MVPASP.NET FAQ : http://asp.net.do/faq/Foros de ASP.NET en Español : http://asp.net.do/foros/======================================"Philipp Schmid" <ph*****@microsoft.com> wrote in messagenews:%2****************@tk2msftngp13.phx.gb l...> Using an ASPX page was my first attempt. However, I haven't found a way to remove the<htm>, <head>, and <body> tags from the response that is generated! Well, guess what - Itried again and now it works!>> So my immediate problem is solved, but I still wonder how to add an ASHX handler to a2.0 web site. I think having an second assembly which contains the handler code isprobably correct. Now why it doesn't get loaded then added as a reference to the project(and is put in the \bin directory) is strange to me. Does this assembly have to be signed(but then the error message could be improved).>> - Philipp>>> "Juan T. Llibre" <no***********@nowhere.com> wrote in messagenews:OO**************@TK2MSFTNGP10.phx.gbl. ..>> Hi, Philipp.>>>> If all you want to do is add a specific extension>> to the pages which are served by your server, use this :>>>> <httpHandlers>>> <add verb="GET, HEAD, POST, DEBUG" path="*.angel"type="System.Web.UI.PageHandlerFacto ry"/>>> </httpHandlers>>> <compilation>>> <buildProviders>>> <add extension=".angel" type="System.Web.Compilation.PageBuildProvider" />>> </buildProviders>>> </compilation>>>>> and map the extension .angel to aspnet_isapi.dll in the>> Application's configuration section in the Internet Service Manager.>>>> That will cause ASP.NET to process the .angel extension>> in the exact same way it processes files with the .aspx extension.>>>> That should be enough for your needs.>>>> If it isn't, post what you want to do with your .angel extension,>> that can't be done in an aspx file.>>>> See my custom extension .juan running at : http://asp.net.do/test/version.juan>>>>>>>>>> Juan T. Llibre, ASP.NET MVP>> ASP.NET FAQ : http://asp.net.do/faq/>> Foros de ASP.NET en Español : http://asp.net.do/foros/>> ======================================>> "Philipp Schmid" <ph*****@microsoft.com> wrote in messagenews:ev**************@tk2msftngp13.phx.gbl. ..>>> I've also tried to create another class library (HandlerLib) project that contains theASHX file and then reference that assembly from my web site project (which promptly addsHandlerLib.dll to the Bin directory). When I then use the assembly name HandlerLib in myweb.config file it still doesn't work. Maybe I need to put it in the GAC?>>>>>> - Philipp>>>>>> BTW, I am using VS.NET 2005 B2 in case that makes any difference.>>>>>> "Philipp Schmid" <ph*****@microsoft.com> wrote in messagenews:Oh**************@TK2MSFTNGP09.phx.gbl. ..>>>> Sorry about that:>>>>>>>> Parser Error Message: The 'type' attribute must be set to a valid Type name (format:<typename>[,<assemblyname>])>>>>>>>> - Philipp>>>>>>>> "Juan T. Llibre" <no***********@nowhere.com> wrote in messagenews:%2******************@tk2msftngp13.phx. gbl...>>>>> What is the error ?>>>>>>>>>> You did not include it.>>>>>>>>>>>>>>>>>>>> Juan T. Llibre, ASP.NET MVP>>>>> ASP.NET FAQ : http://asp.net.do/faq/>>>>> Foros de ASP.NET en Español : http://asp.net.do/foros/>>>>> ======================================>>>>> "Philipp Schmid [MSFT]" <ph*****@microsoft.com> wrote in messagenews:uP****************@TK2MSFTNGP09.phx.gb l...>>>>>>I am trying to add a Generic Handler (ASHX) to my web site solution. In order to dothat I have to specifiy an assembly name in the web.config file. But since 2.0 web sitesare no longer pre-compiled I get an error when trying to load the first page.>>>>>>>>>>>> <system.web>>>>>>> <httpHandlers>>>>>>>>>>>>> <add verb="GET,POST" path="*.angel" type="Namespace.MyHandler" />>>>>>>>>>>>> </httpHandlers>>>>>>>>>>>>> </system.web>>>>>>>>>>>>> I get the following error:>>>>>>>>>>>> Line 51: <system.web>>>>>>> Line 52: <httpHandlers>>>>>>> Line 53: <add verb="GET,POST" path="*.angel" type="Namespace.MyHandler"/>>>>>>> Line 54: </httpHandlers>>>>>>> Line 55: </system.web>>>>>>>>>>>>> - Philipp>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: Lasse Edsvik | last post by:
Hello I'm trying to build a simple COM+ app in vs.net using C# and i cant register it in component manager..... what more is needed than this: using System; using...
0
by: Namratha Shah \(Nasha\) | last post by:
Hi All, Assembly linker is a tool which is used to create an assembly by combining one or more .netmodules and resource files. In simple words an .netmodule is an IL file that does not have ...
0
by: karunakar | last post by:
Hi All I am not able to read the class name I want read the particular class name string path = System.Configuration.ConfigurationSettings.AppSettings; string className = path + ".User";...
3
by: Karl Hungus | last post by:
A cs file I compiled into an assembly dll is in my bin directory. In the cs file I have a using statement for System.Xml I compiled it using this command: csc /out:XmlContent.dll /t:library...
0
by: rh | last post by:
I'm trying to use an ASHX files to send WAV files back to the client. I have links to the ASHX page in an ASPX file and there is a FileID on the querystring. Everything works except the...
3
by: Tim | last post by:
Guys I am trying to create an ashx IHttpHandler that will provide images for me. This is what I have done so far. ' Start test.ashx <%@ WebHandler Language="VB" Class="testashx" %>
2
by: Rod | last post by:
I've been struggling with this thing for 2 days, and after searching the 'net for help, I cannot find what is wrong. We're using Crystal Reports XI Release 2, with Visual Studio .NET 2003 in...
2
by: Max2006 | last post by:
Hi, After I right-click on my web application project file and choose "Publish ." and do the publishing, the result publishable files does not include the *.ashx files. Is it by design? How...
0
by: nickmarkham | last post by:
Hi, I have 'localized' the button images in my web app by using an HTTP handler file for each image so the correct langauge imagebutton can be loaded depending on the users language. In the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.