CMousseau Posted March 22, 2005 Posted March 22, 2005 Ladies and Gentlemen, I have created a VB.NET class that, when given a physical path to a .TIFF file, will output the file, edited to show a watermark. What I would like to do is take this logic and put it in - I believe - an ISAPI filter, and configure my web server so that any time a file of extension .TIFF is fetched, it is put "through the wringer", so that the client browser gets the watermarked .TIFF I am completely over my head at this point, so even the most simplistic of advice that gets me started is greatly appreciated. Charles. Quote
HJB417 Posted March 22, 2005 Posted March 22, 2005 create an IHttpHandler instead HttpHandlers and Factories Quote
CMousseau Posted March 22, 2005 Author Posted March 22, 2005 Thanks for the link! I extracted the code as suggested, yet I am still getting an error, to wit: got the following error message: 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: Could not load type Acme.SimpleHandler from assembly TestWM. Source Error: Line 3: <system.web> Line 4: <httpHandlers> Line 5: <add verb="*" path="test.aspx" type="Acme.SimpleHandler,TestWM"/> Line 6: </httpHandlers> Line 7: </system.web> Here are the steps I went through: First, I created a "Class Library" solution in VB, adding a class file like so: Imports System.Web Namespace Acme Public Class SimpleHandler : Implements IHttpHandler Public Sub ProcessRequest(ByVal Context As HttpContext) Implements IHttpHandler.ProcessRequest Context.Response.Write("Hello World!") End Sub Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable Get Return True End Get End Property End Class End Namespace which I compiled under the name TestWM.dll; the file of which I moved from the project's bin directory to the website's bin directory. I then created a web.config file as directed: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <httpHandlers> <add verb="*" path="test.aspx" type="Acme.SimpleHandler,TestWM"/> </httpHandlers> </system.web> </configuration> The website name, as registered in my IIS directory, is WatermarkTest, and so, I entered the following URL: http://localhost/WatermarkTest/test.aspx giving me the resultant error message. Any ideas? My hunch is that I have a security setting botched. Changing the TestWM in the web.config gives me a different batch of error messages, on the order of "I can't find any assembly named TestWM.dll or TestWM.exe in any of these default directories", yet changing the Acme.SimpleHandler to something nonsensical gives me the same error detailed above. Thanks for your help, Charles. Quote
HJB417 Posted March 22, 2005 Posted March 22, 2005 what assemblies does TestWM reference that aren't located in the gac or the website's bin folder? Quote
CMousseau Posted March 22, 2005 Author Posted March 22, 2005 The file Imports System.web, and has the following references in the reference folder: System System.Data System.Web System.XML And pardon my ignorance, but gac = ? Quote
CMousseau Posted March 22, 2005 Author Posted March 22, 2005 All of the above DLLs referenced are in my directory: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 Quote
HJB417 Posted March 22, 2005 Posted March 22, 2005 global assembly cache That's really weird that it doesn't work for you. can you email me TestWM.dll so I can try it on my machine? finitestate at comcast.net Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.