none
Add Microsoft.Search.Interop.dll to IIS 7

    Question

  • I have been reading threads all day and TechNet but I cannot figure out how to add Microsoft.Search.Interop.dll to my IIS 7 Server 2008 R2 64 bit system so I can run search from a web page against the web site. Seems to have something to do with Modules and .NET Compilation but all I get is errors trying to add it there. We moved the content from a IIS 6 on Server 2003 where this was much easier.

    I get this error when I submit the search.

    Compiler Error Message: CS0234: The type or namespace name 'Search' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

    I have read tons of articles about Visual Studio. I'm not using that. I constructed the pages in Expressions Web 4. Using a thread on this site: http://social.msdn.microsoft.com/Forums/en/windowsdesktopsearchhelp/thread/46ddf830-0b98-4806-a67a-a0aea5d7bac6

    But there is nothing there to describe the action of getting IIS 7 to load this DLL.

    Since I posted this thread I have added the Microsoft.Search.Interop.dll to the Web.Config File:

     

                <assemblies>

                    <clear />

                    <add assembly="mscorlib" />

                    <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

     

                    <add assembly="System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

                    <add assembly="Microsoft.Search.Interop" />

                    <add assembly="*" />

                </assemblies>

     

    When I try to add it to the Modules for the website I get this message:

    --------------------------------------------

    Add Managed Module

     

    There was an error while preforming this operation.

    Details:

     

    Could not load file or assembly ‘Microsoft.Search.Interop.dll’ or

    One of its dependencies. The system cannot find the file specified.

    (C:\inetpub\wwwroot\web.config line 30)

    --------------------------------------------

    No mattter where I put the file on the system, I get this message. Currently it is in the same directory as the first assembly in the config file. C:\Windows\Microsoft.NET\Framework\v2.0.50727

    Thanks for any help.

     

    Saturday, March 12, 2011 9:11 PM

Answers

  • Short answer that worked for me:

    1.    Create a bin directory in the wwwroot directory of the IIS server

    2.    Copy the Microsoft.Search.Interop.dll to it.

    3.    The reference to the dll on the IIS server need only be in your C# aspx.cs file.

    Detail on how I got to the answer:

    I gave up trying to get the Publish function working.

    I simply compared the IIS 7 directory structure on my development PC with the Server. I copied the bin directory from my PC to the server.

    Contents of the bin directory on my PC for my VS2008 project were:

    MyApp.dll
    MyApp.pdb
    MyApp.xml
    Microsoft.Search.Interop.dll

    (PC) C:\inetpub\wwwroot\bin    Copied to:   (Server)  C:\inetpub\wwwroot\bin

    Then in the IIS manager I added a virtual directory called “bin” and pointed it to C:\inetpub\wwwroot\bin on the server.

    That was it. Search now functions in a web browser from a client machine to the server.

    One side note: Despite what I read about the DLL needing to be listed in the web.config file, it is not now. I took it out. It is also not listed in the Server Components\Modules in IIS Manager.

    Simply adding a bin directory and dropping the Microsoft.Search.Interop.dll in to it worked. I also tested removing the MyApp.dll, MyApp.pdb, MyApp.xml files I had copied from my PC IIS bin directory and it still worked. I also removed the Virtual Bin directory from my site on the server but left the physical bin directory in C:\inetpub\wwwroot\bin

    Short answer that worked for me:

    1.    Create a bin directory in the wwwroot directory of the IIS server

    2.    Copy the Microsoft.Search.Interop.dll to it.

    3.    The reference to the dll on the IIS server need only be in your C# aspx.cs file.

     

    I switch to my Visual Studio 2008 and edited the Default.aspx and Default.aspx.cs files there. I added the reference to the Microsoft.Search.Interop.dll, and published it to my local development environment IIS server. No real surprise, it works there. But when I try to publish it to the production environment IIS 7 server it errors out and tells me I have no Front Page Server extensions on the server. The production server is a 2008 R2 Standard. So I researched this problem and according to what I have found the answer is supposed to be to add the Roll Services for IIS 6 Management Compatibility and it’s sub services; Metabase Compatibility, WMI Compatibility, Scripting Tools and Management Console. But they were already installed.
    • Marked as answer by jrh1959a Thursday, March 17, 2011 3:42 PM
    Thursday, March 17, 2011 3:42 PM