473,465 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Custom IApplicationHost

Hi,

I have an application which uses the
ApplicationHost.CreateApplicationHost API to embed ASP.NET. My problem
is that I need to be able to duplicate the virtual directory type
structure supported by IIS, e.g.

URL / maps to c:\mysite
URL /dir1 maps to c:\mysite\dir1

but

URL /dir2 maps to c:\some\other\dir

To do this, it appears I need to create a custom implementation of the
System.Web.Hosting.IApplicationHost interface, but this is internal. The
docs for .NET 3 list this as public
(http://msdn2.microsoft.com/en-us/lib...tionhost.aspx),
but I cannot find a public definition of it after downloading the .NET 3
redist package.

Is there some way to get access to this interface to allow me to write
my own implementation?

Thanks,

Mark
Apr 19 '07 #1
11 1377
Hi Mark,

Sorry about the MSDN documentation, it's not correct here: the interface is
internal and it's not changed by .NET 3.0 runtime; 3.0 runtime only addes
some assemblies, not changed existing .NET 2.0 library.

For your question about supporting multiple virtual directory using
ApplicationHost, I will do some additional research and get back to you.
Thank you for your patience and understanding.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 20 '07 #2
Walter,
Sorry about the MSDN documentation, it's not correct here: the interface is
internal and it's not changed by .NET 3.0 runtime; 3.0 runtime only addes
some assemblies, not changed existing .NET 2.0 library.
That's what I thought - thanks for the confirmation.
For your question about supporting multiple virtual directory using
ApplicationHost, I will do some additional research and get back to you.
Thank you for your patience and understanding.
Thanks - I'd be grateful for any information you can get on this.

Mark
Apr 20 '07 #3
Hi Mark,

To support multiple virtual directory, you must have your own configuration
and use different physical path for each request. I've found that
http://www.systemex.net/CassiniEx/ may be a good reference for you. It's
based on Cassini and has support for multiple web sites and applications in
a single instance. (Note this is a third party implementation)

Hope this helps.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 23 '07 #4
Walter,
To support multiple virtual directory, you must have your own configuration
and use different physical path for each request. I've found that
http://www.systemex.net/CassiniEx/ may be a good reference for you. It's
based on Cassini and has support for multiple web sites and applications in
a single instance. (Note this is a third party implementation)
I've seen CassiniEx, and this seems to work fine for each main request.
The problem comes if you try to do Request.MapPath during a request.

In the CassiniEx model, the HttpWorkerRequest.GetFilePathTranslated
method is overridden to return the correct physical path to the
oringally requested file, e.g. Default.aspx. If that page tries to use
Request.MapPath within its code, that mapping will not use any of the
additional virtual paths.

I have noticed the MapPath method within HttpWorkerRequest, but that
never seems to be called.

Mark
Apr 23 '07 #5
Hi Mark,

I'm still reading the source code of CassiniEx; do you mean that the
AspNetWorkerRequest.MapPath() isn't called? Based on my research, one
possible fix is you need to create a constructor like this:

public AspNetWorkerRequest(string page, string query, TextWriter output)
: base(page, query, output)
{
}

SimpleWorkerRequest's documentation for this constructor:

Initializes a new instance of the System.Web.Hosting.SimpleWorkerRequest
class when the target application domain has been created using the
System.Web.Hosting.ApplicationHost.CreateApplicati onHost(System.Type,System.
String,System.String) method.
I'm not sure if this would help since I haven't a chance to verify. Would
you please try this on your side and let me know the result? Also, it would
be great if you could send me some reproducible code to test the behavior
more quickly. Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 24 '07 #6
Walter,
I'm still reading the source code of CassiniEx; do you mean that the
AspNetWorkerRequest.MapPath() isn't called?
Yes, that appears to be the case. If that was called my problem would be
solved.
Based on my research, one
possible fix is you need to create a constructor like this:

public AspNetWorkerRequest(string page, string query, TextWriter output)
: base(page, query, output)
{
}

SimpleWorkerRequest's documentation for this constructor:

Initializes a new instance of the System.Web.Hosting.SimpleWorkerRequest
class when the target application domain has been created using the
System.Web.Hosting.ApplicationHost.CreateApplicati onHost(System.Type,System.
String,System.String) method.
I'm not sure if this would help since I haven't a chance to verify. Would
you please try this on your side and let me know the result?
This was the basis for my first attempt, which didn't work.
Also, it would
be great if you could send me some reproducible code to test the behavior
more quickly. Thanks.
I'll try to put a simple test app together shortly.

Thanks,

Mark
Apr 24 '07 #7
Walter,
I'll try to put a simple test app together shortly.
I've sent you an example app demonstrating this problem by e-mail.

Mark
Apr 26 '07 #8
Hi Mark,

Let me know if it's difficult to create a simpler reproducible project on
your side.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 26 '07 #9
Hi Mark,

Thanks for the code. I've been able to reproduce the issue on my side.

Furthermore, this looks like an issue in ASP.NET 2.0 since it's working
correctly in ASP.NET 1.1.

I'm currently confirming the behavior with product team. I'll keep you
posted. Thank you again for the feedback!

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 27 '07 #10
Walter,
Thanks for the code. I've been able to reproduce the issue on my side.

Furthermore, this looks like an issue in ASP.NET 2.0 since it's working
correctly in ASP.NET 1.1.

I'm currently confirming the behavior with product team. I'll keep you
posted. Thank you again for the feedback!
Thanks for the update, it's greatly appreciated. Please let me know when
there is a workaround or fix available.

Mark
Apr 27 '07 #11
Hi Mark,

I got some confirmation of the issue from product team, they're currently
still looking into this.

Please email me so that I can update you promptly whenever I get any
further update on it. Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 2 '07 #12

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

Similar topics

5
by: Graham | last post by:
I have created a custom MembershipProvider called "LassieMembershipProvider" that derives from "MembershipProvider". This providor is located in a Businesslogic layer dll called...
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
27
by: Wayne | last post by:
I've been clicking around Access 2007 Beta 2 and can't see the custom menu bar designer. Is it in the beta? Maybe I'm blind. The question that comes to mind is: Will custom menu bars be the same...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
1
by: asharda | last post by:
I have a custom property grid. I am using custom property grid as I do not want the error messages that the propertygrid shows when abphabets are entered in interger fields. The custom property...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.