468,247 Members | 1,317 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,247 developers. It's quick & easy.

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 2558
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

26 posts views Thread by Lasse Edsvik | last post: by
reply views Thread by Namratha Shah \(Nasha\) | last post: by
3 posts views Thread by Karl Hungus | last post: by
3 posts views Thread by Tim | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.