IIS 7 and Above
Deploying a module
Last post Feb 23, 2015 03:45 AM by Jagermeister
Feb 17, 2015 11:26 AM|Jagermeister|LINK
This is a very basic question, I think, but I'm missing something.
I tried creating a custom HTTP module to insert a banner, a warning to our users, on all requests. I think a module is the best way to do this, but if there is any other please let me know.
I followed this tutorial: https://msdn.microsoft.com/en-us/library/ms227673(v=vs.85).aspx
And I added the module to web.config (to system.webServer, since it is running Integrated mode). I also tried adding the module using the interface.
Now my question is, where do I put the compiled DLL generated from the project? How do I register the module to be used by every site in the server?
Maybe it is obvious, but in all the tutorials I found it just says the thing about web.config, but I didn't find how can I "install" the module, or where should I put the DLL.
Thanks a lot!
Feb 17, 2015 09:51 PM|lextm|LINK
Adding modules via IIS Manager is your easiest option, as there you can add them to server level easily. The corresponding configuration file is applicationHost.config.
Feb 18, 2015 04:25 AM|Jagermeister|LINK
Thank you for your reply lextm.
When I go to Modules, Add Managed Module. I enter my module name, and in 'Type' I put the path of the DLL (it is not a type, but anyway). Then it reports: "The specified type cannot be found in the Global Assembly Cache (GAC), so you must install the associated
assembly into the GAC. Do you want to continue to add this managed module?"
I'm surprised I did not find any documentation at all about this.
If I install the DLL with gacutil.exe, is it supposed to be listed among the 'types' in the dropdown list in "Add Managed Module" ? (it is not, I don't know if I did something wrong)
Feb 18, 2015 10:33 PM|lextm|LINK
You might get some ideas from this old thread.
Feb 23, 2015 03:45 AM|Jagermeister|LINK
Thank you, that was quite helpful. My problem was the namespace name, I was not writing the name correctly.
Module doesn't appear yet in the 'Modules' dropdown list, but I can load it in web.config correctly.