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 30569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T13:28:07+00:00 2026-05-10T13:28:07+00:00

I want to reference a COM DLL in a .NET project, but I also

  • 0

I want to reference a COM DLL in a .NET project, but I also want to make sure that the interop DLL created will have the correct version (so that patches will know when the DLL must be changed).

If I use TlbImp I can specify the required version with the /asmversion flag but when I add it directly from Visual Studio it gets a version that has nothing to do with the original COM DLL’s version.

I tried changing the version in the .vcproj file

<ItemGroup>     <COMReference Include='MYDLLLib'>         <Guid>{459F8813-D74D-DEAD-BEEF-00CAFEBABEA5}</Guid>         <!-- I changed this -->         <VersionMajor>1</VersionMajor>          <!-- This too -->            <VersionMinor>0</VersionMinor>          <Lcid>0</Lcid>         <WrapperTool>tlbimp</WrapperTool>         <Isolated>False</Isolated>     </COMReference> </ItemGroup> 

But then the project failed to build with the following error:

error CS0246: The type or namespace name ‘MYDLLLib’ could not be found (are you missing a using directive or an assembly reference?)

Is there any way to get this done without creating all my COM references with TlbImp in advance?

If the answer is yes is there a way to specify a build number in addition to the major and minor versions? (e.g 1.2.42.0)

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T13:28:07+00:00Added an answer on May 10, 2026 at 1:28 pm

    The Guid refers to the Guid for the TypeLib not the DLL directly. The version numbers refer to the TypeLib’s version not the DLLs.

    The version number will come from your idl file, and I believe it only supports a major and minor version and not a build version. Is this version changing when you modify the typelib?

    The version numbers will appear in the registry under:

    HKEY_CLASSES_ROOT\Typelib\{typelib uuid}\Major.Minor 

    If the minor version is set to 0 then I believe it will import the ‘latest’ version that matches the major version, but the major version must be set to something.

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

Sidebar

Related Questions

I have a C++ DLL (no code) that I want to expose to .NET
I have a COM DLL (say, xyz.dll) coded in VC++. I want to create
I have some 3rd party jar files that I want to reference in my
I want to have a seperate project that runs my server communication code in
Looking for good project methodologies.Anyone got some good reference links..want to share.
I have a 32 bit COM component DLL and this DLL is written in
I have a project that I am working on that requires the use of
I am attempting to use Scintilla .NET in a project (I want a good
I want to use a temp directory that will be unique to this build.
I have created a strongly signed assembly in Visual Studio 2008 against the .NET

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.