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

  • SEARCH
  • Home
  • 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 6942267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:59:35+00:00 2026-05-27T12:59:35+00:00

I have a C# 4.0 application that is referencing a type library from a

  • 0

I have a C# 4.0 application that is referencing a type library from a C++ application. This is used for some secure COM interop, a question I originally had asked here.

On my development machine this second application is installed so I can compile without any issues. If I attempt to compile on our automated build server, or any machine with Visual Studio installed but without this second program, I receive the following errors and compilation fails:

Text for google:

The type or namespace name could not be found (are you missing a using directive or an assembly reference?)

Cannot get the file path for type library “guid….” version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

The referenced component ‘SecurityAgentLib’ could not be found

Picture for readability:
compilation error

I’m not sure how to get around this other than by installing the application that registers the actual dll that implements these types, but I don’t want to do that on our build server. The code that uses these types are wrapped in a class that is never instantiated unless prerequisite checks are run to verify the app is actually installed, so there is no chance of a runtime error. In fact I can run my app just fine on a machine without the second app installed – I just can’t compile it there.

In visual studio the reference points to the .tlb file which is included in the solution directory, so the tlb file itself is present.

I can’t imagine it should work this way, and I’ve searched around, but I’m apparently not searching for the right terms.

EDIT:
Running tlbimp.exe generates a dll but the type library should be sufficient for compilation, I thought at least. There is also an issue of broken references. I was reading this article Troubleshooting Broken References and it says that if the reference was to a COM component that is not installed than installing the component corrects the error, which is true.

Installing it on the build server really isn’t an option. Opening visual studio and re-adding a reference if the path was broken doesn’t work either.

I was able to use tlbimp to create a dll and used visual studio add a reference to that dll. That let me compile, but how would this work in an unattended build server?

EDIT
Okay I came up with two solutions that worked given my requirement of this all being unattended

  1. Ran tlbimp to create a dll from the type library. I removed the reference to the tlb from my project and added a reference to the dll itself. When the source code was copied over to a new computer it compiled without issues.

In this scenario ideally we would checkout from SVN on the build server and copy the latest DLL from the second project, then compile this project.

  1. I also removed the tlb and added the dll in visual studio and did a diff on the .csproj file. I don’t see any downside to just having a reference to the dll instead of the tlb but if needed the build server could make modifications directly to this file to remove the tlb section and add a reference to the dll following a build of the second product.
  • 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-27T12:59:35+00:00Added an answer on May 27, 2026 at 12:59 pm

    Here are a couple options that each worked.

    • Ran tlbimp to create a dll from the type library. I removed the reference to the tlb from my project and added a reference to the dll itself. When the source code was copied over to a new computer it compiled without issues.

    In this scenario ideally we would checkout from SVN on the build server and copy the latest DLL from the second project, then compile this project.

    • I also removed the tlb and added the dll and did a diff on the .csproj file. I don’t see any downside to just having a reference to the dll instead of the tlb but the build server could make modifications directly to this file to remove the tlb
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Morning all, I know that this sounds like a simple referencing problem from the
I posted this question a few days ago, and I have some follow up
I have an application written in VB.NET that interacts with Excel via interop. I
I have a ASP.net application that is referencing a external assembly that I need
I have an application that reads a table from a database. I issue an
I have an ASP.NET application that uses the Fluorine FX remoting library. When the
I have an application that holds data referencing 300,000 customers. When a user did
I have a WPF 4.0 application that utilizes some custom 16x16 icons in things
I have application that makes different queries with different results so the caching in
I have application that is connecting to the DB and if I enter incorrect

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.