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.
kollisp
Member
10 Points
9 Posts
Configuring HTTPModule at WebSite level
Sep 19, 2011 10:03 AM|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
Rajganesh
Participant
1117 Points
188 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 11:01 AM|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.
kollisp
Member
10 Points
9 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 11:40 AM|LINK
Hi Rajganesh,
Thanks for the reply.
I have added my custom HTTPModule in web.config file for the web site.
httpmodule
Rajganesh
Participant
1117 Points
188 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 11:51 AM|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.
kollisp
Member
10 Points
9 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 11:59 AM|LINK
Sorry I didnt understand about adding reference.
How to add the reference.
Thanks
Sai Prasad
Rajganesh
Participant
1117 Points
188 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 12:08 PM|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.
kollisp
Member
10 Points
9 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 12:15 PM|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
Rajganesh
Participant
1117 Points
188 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 12:19 PM|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.
kollisp
Member
10 Points
9 Posts
Re: Configuring HTTPModule at WebSite level
Sep 19, 2011 01:04 PM|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
Rajganesh
Participant
1117 Points
188 Posts
Re: Configuring HTTPModule at WebSite level
Sep 20, 2011 03:19 AM|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.