seperate nested ASP.NET application in IIS 6.0

M

Michael Porcelli

Greetings,

I am encountering some difficulties setting up a separate nested ASP.NET
application. The problem seems to be caused by the .NET runtime attempting
to load an assembly referenced by the root application from locations
relative to the sub application. My intention is for the nested application
to be totally separate and isolated from the root application. I have no
need for the assembly referenced in the root application to be used by the
nested application and I do not want the .NET runtime to attempt to load the
assembly referenced by the root application when I am attempting to use the
nested application. The sub application contains no references to the type
being searched for by the .NET run time. Here is an illustration of this
scenario:

***
* Folder structure
*
/RootApp <-- IIS web server root
|
- /bin
| |
| - RootApp.dll
| |
| - CustomHandler.dll <-- contains CustomHandler.Dispatcher
|
- /SubApp <-- IIS AppRoot
| |
| - /bin
| |
| - SubApp.dll
| |
| - default.aspx
| |
| - global.asax
| |
| - web.config
|
- default.aspx
|
- global.asax
|
- web.config

***
* /RootApp/web.config
*
....
<httpHandlers>
<add verb="*" path="*.custom" type="CustomHandler.Dispatcher,
CustomHandler" />
</httpHandlers>
....

***
* ASP.NET error message attempting http:// ... /SubApp/default.aspx
*
Server Error in '/SubApp' Application.

Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: File or assembly name CustomHandleror one of its
dependencies, was not found.

Source Error:

Line 105: <httpHandlers>
Line 106: <add verb="*" path="*.custom" type="CustomHandler.Dispatcher,
CustomHandler" />
Line 107: </httpHandlers>

Source File: C:\web\RootApp\web.config Line: 106

Assembly Load Trace: The following information can be helpful to determine
why the assembly 'CustomHandler' could not be loaded.

=== Pre-bind state information ===
LOG: DisplayName = CustomHandler
(Partial)
LOG: Appbase = file:///C:/web/RootApp/SubApp
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: CustomHandleror
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/SubApp/9df12f55/f32552ad/CustomHandler.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/SubApp/9df12f55/f32552ad/CustomHandler/CustomHandler.DLL.
LOG: Attempting download of new URL
file:///C:/web/RootApp/SubApp/bin/CustomHandler.DLL.
LOG: Attempting download of new URL
file:///C:/web/RootApp/SubApp/bin/CustomHandler/CustomHandler.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/SubApp/9df12f55/f32552ad/CustomHandler.EXE.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/SubApp/9df12f55/f32552ad/CustomHandler/CustomHandler.EXE.
LOG: Attempting download of new URL
file:///C:/web/RootApp/SubApp/bin/CustomHandler.EXE.
LOG: Attempting download of new URL
file:///C:/web/RootApp/SubApp/bin/CustomHandler/CustomHandler.EXE.

***

It is my understanding that if a new web application is configured with IIS
in the SubApp directory, it should execute separately from the containing
root app. It seems to be an error that the .NET runtime is attempting to
load ans assembly that is not even referenced by the application. I feel
like I am missing something. I appreciate any insight on this.

Thanks,
-m.
 
J

John Saunders

This is a known pain in the ass. Put a dummy copy of "CustomHandler" into
the bin directory of your sub-application.

And, Microsoft, PLEASE fix this for ASP.NET 2.0 or 1.2 or whatever. This is
seriously uncool.
 
S

Steven Cheng[MSFT]

Hi Michael,

Thanks for posting here. From your description, you've two web applications
one is a sub application which is nested in another and the root
application has registered an httphandler and put the handler's dll in the
root app's bin folder without puting in the sub app's bin folder. However,
when the user try accessing the sub app, we'll encounter the exception
that can't found the httphandler's assembly in the subapp's bin folder, yes?

As for this problem, I agree with John that this is a known issue of the
ASP.NET and I've also tried some tests on my side testing on override the
subapp's web.config file and also with no success. I'm afraid the
workaround currently is to copy the certain assembly in both the two bin
folders of the two apps. Anyway, I'm sorry for the inconvenience it bring
to you.

In addtion, this is a great idea for a future product enhancement. I'd
recommend that you forward the recommendation to the Microsoft Wish Program:

Microsoft offers several ways for you to send comments or suggestions about
Microsoft products.

World Wide Web - To send a comment or suggestion via the Web, use one of
the following methods:
##Visit the following Microsoft Product Feedback Web site:
http://register.microsoft.com/mswish/suggestion.asp" and then complete and
submit the form.

##E-mail - To send comments or suggestions via e-mail, use the following
Microsoft Wish Program e-mail address, (e-mail address removed).


Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top