Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 969717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:41:09+00:00 2026-05-16T02:41:09+00:00

I have an Interop dll that was generated by Visual Studio for a third-party

  • 0

I have an Interop dll that was generated by Visual Studio for a third-party COM object that I am consuming in a .NET dll.

I have registered both my consuming dll and the Interop dll in the GAC. I have to use the GAC because these DLLs are being used by a SharePoint 2010 workflow.

When the execution gets to the point where my dll calls the Interop dll the following error was thrown” “Could not load file or assembly” … “The system could not find the file specified” together with the expected version and public key.

If I examine the Fusion Assembly Binding Log Viewer, the following error is listed in the log entry of the Interop dll:

LOG: GAC Lookup was unsuccessful.

I can see that assembly in the GAC, and it has the correct version and public key token as specified in the FileNotFound exception.

What’s going on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T02:41:10+00:00Added an answer on May 16, 2026 at 2:41 am

    The problem is that, as well as Version and Public Key being valid, the Processor Architecture of the Interop must match that of your calling DLL. And, of course, the Target Framework must be the same version.

    My dll was compiled to the MSIL (Agnostic, AnyCPU) processor, but for some strange reason Visual Studio insisted on compiling the Interop to x386.

    (Maybe this wouldn’t normally cause an issue, but my SharePoint server is 64 bit, which may have caused the symptoms to appear).

    The solution is to compile the Interop yourself:

    1 – Unregister your dll and the Interop from the GAC.

    2 – Start the Visual Studio Command Prompt of the Visual Studio version that relates to the .NET framework your dll is targeting (i.e. I was developing my dll in Visual Studio 2010, targeting .NET 3.5. To do this step I needed to start the Visual Studio 2008 Command Prompt)

    3 – Generate the Interop using Tlbmp

    tlbimp <full path and filename of  COM .tlb>  /out:c:\.\Interop.CoolThirdParty.dll /keyfile: <full path and filename of snk> /machine:Agnostic /Namespace:CoolThirdParty  
    

    The /machine:Agnostic causes the Interop to be built targeting the MSIL Processor Architecture, which is the same as my dll.

    4 – Remove the old reference to the Interop in your dll project

    5 – Delete the old Interop file and replace it with the one that you have just generated (e.g. c:.\Interop.CoolThirdParty.dll)

    6 – Add a reference in your project to the new Interop.

    7 – Rebuild

    8 – Register your newly build dll and the new Interop in the GAC

    It should start working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a com interop c++ dll that is loaded in c++ throught the
Python -> c++ dll -> c# dll I have a com interop c# dll
Sorry about the terrible title. I have a signed assembly 'Signed.dll' that is a
I have my own custom tool for Visual Studio 2008 SP1. It consists of
There are some bug fixes that have been done in a COM component. Each
I have been having a prolonged encounter with the beast known as COM Interop...
I've added a reference to a co-worker's COM DLL -- MyLogic.dll -- to my
I have several ActiveX components that needed to be accessed from a C# project.
I have an annoying problem in one of my projects where the production environment

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.