Monday, March 26, 2012

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>
- PhilippWhat 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 Espaol : http://asp.net.do/foros/
======================================
"Philipp Schmid [MSFT]" <philsch@.microsoft.com> wrote in message
news:uPfiiD%233FHA.1416@.TK2MSFTNGP09.phx.gbl...
>I am trying to add a Generic Handler (ASHX) to my web site solution. In ord
er to do that
>I have to specifiy an assembly name in the web.config file. But since 2.0 w
eb 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.M
yHandler" />
> Line 54: </httpHandlers>
> Line 55: </system.web>
> - Philipp
>
Sorry about that:
Parser Error Message: The 'type' attribute must be set to a valid Type name
(format: <typename>[,<assemblyname>])
- Philipp
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:%23SHvCq%233FHA.2196@.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 Espaol : http://asp.net.do/foros/
> ======================================
> "Philipp Schmid [MSFT]" <philsch@.microsoft.com> wrote in message
> news:uPfiiD%233FHA.1416@.TK2MSFTNGP09.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" <philsch@.microsoft.com> wrote in message
news:Ohlg$IB4FHA.3876@.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" <nomailreplies@.nowhere.com> wrote in message
> news:%23SHvCq%233FHA.2196@.tk2msftngp13.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...asp.net.do/faq/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Philipp Schmid" <philsch@.microsoft.com> wrote in message
news:evOQkqH4FHA.2600@.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 Ha
ndlerLib 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" <philsch@.microsoft.com> wrote in message
> news:Ohlg$IB4FHA.3876@.TK2MSFTNGP09.phx.gbl...
>
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" <nomailreplies@.nowhere.com> wrote in message
news:OOB1r4H4FHA.3276@.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 Espaol : http://asp.net.do/foros/
> ======================================
> "Philipp Schmid" <philsch@.microsoft.com> wrote in message
> news:evOQkqH4FHA.2600@.tk2msftngp13.phx.gbl...
>
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/d...br />
andl.asp
and has quite extensive sample code at :
http://download.microsoft.com/downl...
s.msiAnalyzing Scott's sample code might help you dissectwhy yours isn't working the wa
y you'd like it to work.Juan T. Llibre, ASP.NET MVPASP.NET FAQ : http://as
p.net.do/faq/Foros de ASP.NET en Espaol : http://asp.net.do/foros/===========...==============="Philipp Schmid" <philsch@.microsoft.com> wrote in mes
sagenews:%23s8HEBI4FHA.2196@.tk2msftngp13.phx.gbl...> Using an ASPX page was
my first attempt. How
ever, 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 s
ite. I think having an second assembly which contains the handler code ispro
bably correct. Now why it doesn't get loaded then added as a reference to th
e project(and is put in the \bin directory) is strange to me. Does this asse
mbly have to be signed(but
then the error message could be improved).>> - Philipp>>> "Juan T. Llibre" <
nomailreplies@.nowhere.com> wrote in messagenews:OOB1r4H4FHA.3276@.TK2MSFTNGP1
0.phx.gbl...>> Hi, Philipp.>>>> If all you want to do is add a specific exte
nsion>> to the pages which
are served by your server, use this :>>>> <httpHandlers>>> <add verb="GET, H
EAD, POST, DEBUG" path="*.angel"type="System.Web.UI.PageHandlerFactory"/>>>
</httpHandlers>>> <compilation>>> <buildProviders>>> <add extension=".angel"
type="System.Web.Compilati
on.PageBuildProvider" />>> </buildProviders>>> </compilation>>>>> and map th
e extension .angel to aspnet_isapi.dll in the>> Application's configuration
section in the Internet Service Manager.>>>> That will cause ASP.NET to proc
ess 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 w
ith your .angel extension,>> that can't be done in an aspx file.>>>> See my
custom extension .juan runn
ing 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 Espaol : [url]http://asp.net.do/foros/[/
url]>> ======================================>> "Philipp Schmid" <philsch@.mi
croso
ft.com> wrote in messagenews:evOQkqH4FHA.2600@.tk2msftngp13.phx.gbl...>>> I'v
e also tried to create another class library (HandlerLib) project that conta
ins theASHX file and then reference that assembly from my web site project (
which promptly addsHandlerL
ib.dll to the Bin directory). When I then use the assembly name HandlerLib i
n 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 an
y difference.>>>>>> "Philip
p Schmid" <philsch@.microsoft.com> wrote in messagenews:Ohlg$IB4FHA.3876@.TK2M
SFTNGP09.phx.gbl...>>>> Sorry about that:>>>>>>>> Parser Error Message: The
'type' attribute must be set to a valid Type name (format:<typename>[,<assem
blyname>])>>>>>>>> - Philip
p>>>>>>>> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in messagenews:%23SHvCq%23
3FHA.2196@.tk2msftngp13.phx.gbl...>>>>> What is the error ?>>>>>>>>>> You did not includ
e it.>>>>>>>>>>>>>>>>>>>> Juan T. Llibre, ASP.NET MVP>>>>> ASP.NET FAQ : http://a[
/url]
sp.ne...p.net.do/foros/>>>>> ==
====================================>>>>> "Philipp Schmid [MSFT]" <philsch@.microso
ft.com> wrote in messagenews:uPfiiD%233FHA.1416@.TK2MSFTNGP09.phx.gbl...>>>>>
>I am trying to
add a Generic Handler (ASHX) to my web site solution. In order to dothat I h
ave to specifiy an assembly name in the web.config file. But since 2.0 web s
itesare no longer pre-compiled I get an error when trying to load the first
page.>>>>>>>>>>>> <system.
web>>>>>>> <httpHandlers>>>>>>>>>>>>> <add verb="GET,POST" path="*.angel" ty
pe="Namespace.MyHandler" />>>>>>>>>>>>> </httpHandlers>>>>>>>>>>>>> </system
.web>>>>>>>>>>>>> I get the following error:>>>>>>>>>>>> Line 51: <syste
m.web>>>>>>> Line 52:
<httpHandlers>>>>>>> Line 53: <add verb="GET,POST" path="*.angel
" type="Namespace.MyHandler"/>>>>>>> Line 54: </httpHandlers>>>>>>>
Line 55: </system.web>>>>>>>>>>>>> - Philipp>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
Grrr!
I hate it when OE garbles messages.
Here's the previous message, in a new message with the same subject.
Hopefully, it will not be garbled.
=========
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/d...br />
andl.asp
and has quite extensive sample code at :
http://download.microsoft.com/downl...SDNHandlers.msi
Analyzing Scott's sample code might help you dissect
why yours isn't working the way you'd like it to work.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Philipp Schmid" <philsch@.microsoft.com> wrote
It beats having to use the Web Interface....trust me...
:}
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
"Juan T. Llibre" wrote:

> Grrr!
> I hate it when OE garbles messages.
> Here's the previous message, in a new message with the same subject.
> Hopefully, it will not be garbled.
> =========
> 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/d... />
phandl.asp
> and has quite extensive sample code at :
> http://download.microsoft.com/downl...SDNHandlers.msi
> Analyzing Scott's sample code might help you dissect
> why yours isn't working the way you'd like it to work.
>
> 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" <philsch@.microsoft.com> wrote
>
>
>
It's a bug, and I'll report it as such.
It happens when I insert a hyperlink with a leading space at the
beginning of the line, but only if the hyperlink is more than a certain leng
th.
I'm working on figuring out the repro parameters and then I'll bug it.
But, you're absolutely right : it sure beats using the web interface.
;-)
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:C3B30A1A-5763-4516-AB55-5CF09C5A46F0@.microsoft.com...
> It beats having to use the Web Interface....trust me...
> :}
> --
> Curt Christianson
> site: http://www.darkfalz.com
> blog: http://blog.darkfalz.com
>
> "Juan T. Llibre" wrote:
>

0 comments:

Post a Comment