Tuesday, May 25, 2004

Searching Indexing Services with ASP.NET and C# Part III

I pretty much thought  I had this whole Searching Indexing Services with ASP.NET all wrapped up, till my Boss' Boss' kept getting an "Access Denied Error". However it was extremely intermittent. It would work great three of four times and then show up. These kind of intermittent problems are so frustrating. How can you fix something that you can't reproduce everytime? Or even every other time? So after about an hour of doing google searchs, I found an article on support.microost.com. FIX: "Access Is Denied" Error Message When You Try to Access Indexing Service from ASP.NET with Impersonation Enabled.

Being that I am using impersonation in my application, I felt at least this could get me on the right track. The first thing that it mentioned was if you are on Windows 2000 serve rupgrade to service pack 4. We have been a little leary of service pack 4, but I crossed my fingers, toes, eyes and installed the services pack. To my surpise it installed cleanly, but didn't fix the issue. So re-reading the article it talked about adding something to the web.config. My web config was already pretty customized, but I through caution to the wind (after making a complete back up) and added the code. It worked! This is what I added. Make sure it is outside of your current <system.web> node.

<location path="filename.aspx">
<system.web>
   <identity impersonate="false" />
</system.web>
</location>

It' basically turns off impersonation just for the file. And as I gave ASP.NET full access to my catalog. It runs beautiful.

No comments: