By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,156 Members | 1,004 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,156 IT Pros & Developers. It's quick & easy.

asp.net 2.0 - build provider for aspx?

P: n/a
Hello,

Using ASP.NET v2.0.40607.42, I'm attempting to create a new file
extension that should be handled exactly like "aspx" pages. For
example, I just want to rename an aspx page from "test.aspx" to
"test.extx", where .extx extensions are handled in exactly the same way
as aspx pages.

In pre-2.0 versions of ASP.NET, simply adding a HttpHandler element
(below) to web.config, and adding a IIS mapping of "extx" to
aspnet_isapi.dll was sufficient:

<httpHandlers>
<add verb="*" path="*.extx" type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>

Now, in 2.0 I get this error:

There is no build provider registered for the extension '.extx'. You
can register one in the <compilation><buildProviders> section in
machine.config or web.config. Make sure the appliesTo attribute
includes the value 'Web' or 'All'.

I cannot find any good reference about build providers. I don't think
I should have to write a custom build provider because I want the page
to use whatever standard aspx pages use. What is the default build
provider class used for aspx pages?
Any advice will be greatly appreciated!

Best,
chris

Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I believe the config would look something like this for 2.0:

<buildProviders>
<add extension=".extx" appliesTo="" type="System.Web.UI.PageHandlerFactory"
/>
</buildProviders>

Although I'm not 100% about the appliesTo attribute.

--
Scott
http://www.OdeToCode.com/blogs/scott/
Hello,

Using ASP.NET v2.0.40607.42, I'm attempting to create a new file
extension that should be handled exactly like "aspx" pages. For
example, I just want to rename an aspx page from "test.aspx" to
"test.extx", where .extx extensions are handled in exactly the same
way as aspx pages.

In pre-2.0 versions of ASP.NET, simply adding a HttpHandler element
(below) to web.config, and adding a IIS mapping of "extx" to
aspnet_isapi.dll was sufficient:

<httpHandlers>
<add verb="*" path="*.extx" type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>
Now, in 2.0 I get this error:

There is no build provider registered for the extension '.extx'. You
can register one in the <compilation><buildProviders> section in
machine.config or web.config. Make sure the appliesTo attribute
includes the value 'Web' or 'All'.

I cannot find any good reference about build providers. I don't think
I should have to write a custom build provider because I want the page
to use whatever standard aspx pages use. What is the default build
provider class used for aspx pages?
Any advice will be greatly appreciated!
Best,
chris

Nov 19 '05 #2

P: n/a
<buildProviders>
<add
extension="String"
appliesTo="String"
type="String" />
</buildProviders>

extension is the File Extension
appliesTo is the Directory where the file resides
type is the Type Name of the build provieder class used to invoke the
compliation

This is an exert from:
"A First Look at ASP.NET v. 2.0" (Homer/Sussman/Howard) (Addison Wesley).
Pg 431-432

There is an update, newer version, of this book as well... go get it.
I suggest this to ALL who are working with 2.0

--
Curt Christianson
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Christopher Baldwin" <cb******@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Hello,

Using ASP.NET v2.0.40607.42, I'm attempting to create a new file
extension that should be handled exactly like "aspx" pages. For
example, I just want to rename an aspx page from "test.aspx" to
"test.extx", where .extx extensions are handled in exactly the same way
as aspx pages.

In pre-2.0 versions of ASP.NET, simply adding a HttpHandler element
(below) to web.config, and adding a IIS mapping of "extx" to
aspnet_isapi.dll was sufficient:

<httpHandlers>
<add verb="*" path="*.extx" type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>

Now, in 2.0 I get this error:

There is no build provider registered for the extension '.extx'. You
can register one in the <compilation><buildProviders> section in
machine.config or web.config. Make sure the appliesTo attribute
includes the value 'Web' or 'All'.

I cannot find any good reference about build providers. I don't think
I should have to write a custom build provider because I want the page
to use whatever standard aspx pages use. What is the default build
provider class used for aspx pages?
Any advice will be greatly appreciated!

Best,
chris

Nov 19 '05 #3

P: n/a
Chris,

What you want to do ( process a custom file extension ) is
poorly documented in the ASP.NET 2.0 beta documentation,
but fairly easy to do.

Here's what you need to do :

Open the Internet Services Manager.
If your folder isn't configured as an Application,
configure it as an Application before proceeding.

1. Right-click the virtual folder that contains
your ASP.NET application, and then click Properties.

2. Click the Configuration button.

3. Highlight and Click the .aspx application mapping, and then click Edit.

4. Select the text in the Executable text box,
and then press CTRL+C to copy the text to your clipboard.
Click Cancel to return to the Application Configuration dialog box.

5. Click the "Add" button, paste the clipboard text into the "Executable" textbox,
and write in the file extension you want ( chris, for example - don't include the dot)

6. In the Verbs section, click to select Limit To, and then copy and paste "GET, HEAD, POST, DEBUG"
( without the quotes ) in the text box.

Click OK 3 times to get out of the Application Properties.

Now, here's a sample web.config to enable the .chris extension :

web.config :
------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<httpHandlers>
<add verb="GET, HEAD, POST, DEBUG" path="*.chris" type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>
<compilation>
<buildProviders>
<add extension=".chris" appliesTo="Web" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
</system.web>
</configuration>
-----------------
That's it!

You can now access pages with the .chris extension,
and they will be processed just like .aspx pages are processed.

Easy, isn't it ?

Let us know how you do.

Juan T. Llibre
ASP.NET MVP
===========
"Christopher Baldwin" <cb******@gmail.com> wrote in message news:11*********************@z14g2000cwz.googlegro ups.com...
Hello,

Using ASP.NET v2.0.40607.42, I'm attempting to create a new file
extension that should be handled exactly like "aspx" pages. For
example, I just want to rename an aspx page from "test.aspx" to
"test.extx", where .extx extensions are handled in exactly the same way
as aspx pages.

In pre-2.0 versions of ASP.NET, simply adding a HttpHandler element
(below) to web.config, and adding a IIS mapping of "extx" to
aspnet_isapi.dll was sufficient:

<httpHandlers>
<add verb="*" path="*.extx" type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>

Now, in 2.0 I get this error:

There is no build provider registered for the extension '.extx'. You
can register one in the <compilation><buildProviders> section in
machine.config or web.config. Make sure the appliesTo attribute
includes the value 'Web' or 'All'.

I cannot find any good reference about build providers. I don't think
I should have to write a custom build provider because I want the page
to use whatever standard aspx pages use. What is the default build
provider class used for aspx pages?
Any advice will be greatly appreciated!

Best,
chris

4
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.794 / Virus Database: 538 - Release Date: 11/11/2004
Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.