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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:26:43+00:00 2026-06-09T05:26:43+00:00

We have a COM component project and one Windows setup project which registers the

  • 0

We have a COM component project and one Windows setup project which registers the COM component. I have checked the previous build of the setup project, it seems that the CLSID generated for the classes in COM project always change, even though sometimes there is no change in those classes. This is somehow our desired way because we want to keep different versions implementations at the same machine. However, when I build this project manually and run regasm.exe with /regfile option several times at the same day, the CLSID in the generated reg file are always the same. It think in the previous cases where they changed, it is because they were built at different days, but I am not sure. So could anyone tell me what is the (default) rule of this CLSID auto-generation? I think we are using the default settings in the project.

I am not sure whether the assembly version affects the result. But we assign the assembly version number as Major.Minor.*, which means the third number (build number) is the days since 1.1.2000 and the fourth number (revision number) is number of seconds since midnight divided by two. In the case that the CLSID changes even though the classes code don’t change, the major and minor numbers are also the same. So if the version number does affect the CLSID, I can tell that it doesn’t only take major and minor numbers into account.

And of course we didn’t assign static GUIDs for those classes otherwise it would not change in our setup project.

Thanks for any help!

  • 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-06-09T05:26:44+00:00Added an answer on June 9, 2026 at 5:26 am

    Yes, the CLR automatically generates guids for interfaces and classes if you do not explicitly use the [Guid] attribute. It does it well, it includes all the parts of the assembly and class declaration that would risk making your code binary incompatible with the previous version. Very important in COM, such incompatibility can be terribly difficult to diagnose.

    The algorithm uses the fully specified type name and the declarations of the methods and fields in the type. Turning them into a string (“stringizing the declaration”) and transforming the resulting string into a guid by hashing it. “Fully specified type name” is your nemesis here, that includes the [AssemblyVersion]. Which entirely makes sense, incrementing the assembly version is a Big Deal that makes assemblies incompatible with any code that uses the assembly. Such code has to be recompiled. COM clients are no exception.

    As stated, you can specify your own [Guid] attribute to force the CLSID to a specific value. At the risk of invoking DLL Hell when you get it wrong and make breaking changes but don’t recompile the client code. The failure mode is nasty, pretty random AccessViolation exceptions or just plain calling the wrong method. You ought to fall back to ComInterfaceType.IsIDispatch when you do this so the client code is forced to use late binding. Or control your build and deployment process with an iron fist.

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

Sidebar

Related Questions

I have installed my windows application that uses TeeChart ActiveX (a COM Component for
I have a .NET 2.0 project that needs to use a COM component (specifically
I have a COM component written in C# that makes calls to ConfigurationManager.AppSettings.Get(...). This
I have an ATL COM component method which takes a BSTR as an in
I have an STA COM component which is put into a COM+ application. The
I have a 32 bit COM component that is used mostly by ASP, we
We have a a VB6 app (in a COM component) which uses CDate() to
I have the following COM object installed on one of our servers that I
I have a c# unit test project that is compiled for AnyCPU. Our build
I have a COM dll which I was using in my .net project through

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.