When I try to access a virtual directory under the web site its trying to load CustomModule.CustomModule.
And throwing an error
Exception information: Exception type: ConfigurationErrorsException Exception message: Could not load type 'CustomModule.CusotmModule'. (c:\inetpub\wwwroot\web.config line 5) (c:\inetpub\wwwroot\web.config line 5)
Well, I understood your problem now. As this HTTPModule is going to be common for all the virtual directories, I think you need to add your HTTPModule dll to the GAC.
Can you try adding your dll to GAC, so that it would be referenced in all your virtual directories.
Rajganesh
__________________________________________________
My Blog If this post answers your question please mark it as Answered.
Could not load file or assembly 'httphandler1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4f62e909d171324d'
or one of its dependencies. The system cannot find the file specified. (D:\WebSite17\web.config line 75)
When you add a module to the root of your Web site, it's visible to all child virtual directories.
As such you have to make sure the module is available to run in all child virtuals (ie. either in the BIN folder or the GAC)
You can explicitly remove the module from child virtuals with the <remove> key in the handlers section if you don't want it to fire in the child virtual.
None
0 Points
8 Posts
Configuring HTTPModule at WebSite level
Sep 19, 2011 06:03 AM|kollisp|LINK
Hi,
I have written a HTTPModule extending IHTTPModule. Can this HTTPModule be installed for a website instead of a virtual directory in IIS.
Like for the whole DefaultWebSite.
Thanks
Sai Prasad
httpmodule
Member
730 Points
188 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 07:01 AM|Rajganesh|LINK
Register your HTTPModule in the machine.config file. Below link may help you.
http://stackoverflow.com/questions/4078326/httpmodule-over-multiple-sites
http://msdn.microsoft.com/en-us/library/ms227673.aspx
httpmodule
__________________________________________________
My Blog
If this post answers your question please mark it as Answered.
None
0 Points
8 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 07:40 AM|kollisp|LINK
Hi Rajganesh,
Thanks for the reply.
I have added my custom HTTPModule in web.config file for the web site.
httpmodule
Member
730 Points
188 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 07:51 AM|Rajganesh|LINK
Have you added the reference to the CustomModule.CusotmModule in your website?
__________________________________________________
My Blog
If this post answers your question please mark it as Answered.
None
0 Points
8 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 07:59 AM|kollisp|LINK
Sorry I didnt understand about adding reference.
How to add the reference.
Thanks
Sai Prasad
Member
730 Points
188 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 08:08 AM|Rajganesh|LINK
Is the code for HTTPModule is available under the App_Code directory of the website or is it an external dll?
If it is an external dll file you need to add the reference to the dll file in your website.
__________________________________________________
My Blog
If this post answers your question please mark it as Answered.
None
0 Points
8 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 08:15 AM|kollisp|LINK
It is an external dll.
Sorry for the following question I am new to this IIS and HTTPModules
How to add reference to the dll in the website.
My HTTPModule is also dependent on other dlls.
Thanks
Sai Prasad
Member
730 Points
188 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 08:19 AM|Rajganesh|LINK
As it is an external dll, you need to add the reference to the dll to the website.
Check the below link to learn more about adding reference.
http://msdn.microsoft.com/en-us/library/wkze6zky.aspx
http://msdn.microsoft.com/en-us/library/7314433t(v=vs.90).aspx
__________________________________________________
My Blog
If this post answers your question please mark it as Answered.
None
0 Points
8 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 09:04 AM|kollisp|LINK
Rajganesh,
May be I was not clear in explaining my issue.
Links you have provided are showing how to add references of a external dll to asp.net applications I create in visual studiol
Here is the issue I am facing.
Under IIS WebSites we have Default Web Site. I have created External Web Site under WebSites with a different IP.
There are virtual directories under both the Default and External web site. I have to apply a custom HTTPModule to only Default Web Site.
If the user access any virtual directory under Default web site the modules kicks in.
If the user access any virtual directory under External web site module shoud not do anything.
So I thought may be this HTTPModule can be configured at the WebSite level instead for each virtual directory.
I created a config file under Default Web Site root folder where I have provided configuration for the HTTPModule.
When I a hit virutal directory URL from browser its trying to load Module but failing with the exception I have sent earlier.
Sorry for the confusion created.
Thanks
Sai Prasad
Member
730 Points
188 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 11:19 PM|Rajganesh|LINK
Well, I understood your problem now. As this HTTPModule is going to be common for all the virtual directories, I think you need to add your HTTPModule dll to the GAC.
Can you try adding your dll to GAC, so that it would be referenced in all your virtual directories.
__________________________________________________
My Blog
If this post answers your question please mark it as Answered.
None
0 Points
6 Posts
Re: Configuring HTTPModule at WebSite level
Nov 22, 2011 01:22 AM|venubabum.net|LINK
i copied dll in GAC,after that registered the dll in web.config but it is not working.
<add name="modulename" type="httphandler1.handlerclass,httphandler1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4f62e909d171324d"/>
it is showing error
Could not load file or assembly 'httphandler1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4f62e909d171324d' or one of its dependencies. The system cannot find the file specified. (D:\WebSite17\web.config line 75)
httpmodule
Participant
1471 Points
442 Posts
ASPInsiders
MVP
Re: Configuring HTTPModule at WebSite level
Dec 05, 2011 06:53 PM|rstrahl|LINK
Just for clarification:
When you add a module to the root of your Web site, it's visible to all child virtual directories.
As such you have to make sure the module is available to run in all child virtuals (ie. either in the BIN folder or the GAC)
You can explicitly remove the module from child virtuals with the <remove> key in the handlers section if you don't want it to fire in the child virtual.
+++ Rick ---
httpmodule
West Wind Technologies
Making waves on the Web
weblog.west-wind.com
Check out: Markdown Monster