Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. How to generate strong key name for an interop?

How to generate strong key name for an interop?

Scheduled Pinned Locked Moved COM
helpquestioncsharpc++com
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shilpa1
    wrote on last edited by
    #1

    Hi, I have to build a layer of serviced components over a DAL (data access layer). Now this DAL was written using interop in VC++. I built my component using a snk - which worked fine till i added the code to access DAL. Now it gives me an error sayin that assemly cannot be created as DAL does not have a strong name. How do I get rid of this problem? How can i reuse the existing component without having to rewrite it in .net environment? I recently read an article sayin that i would have to generate a strong key for the interop dll using tlbimp... but i somehow am not able to figure the parameters out ... has anybody done this? Any help will be appreciated!

    M 1 Reply Last reply
    0
    • S Shilpa1

      Hi, I have to build a layer of serviced components over a DAL (data access layer). Now this DAL was written using interop in VC++. I built my component using a snk - which worked fine till i added the code to access DAL. Now it gives me an error sayin that assemly cannot be created as DAL does not have a strong name. How do I get rid of this problem? How can i reuse the existing component without having to rewrite it in .net environment? I recently read an article sayin that i would have to generate a strong key for the interop dll using tlbimp... but i somehow am not able to figure the parameters out ... has anybody done this? Any help will be appreciated!

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      You only have to generate a strong name for interop if you plan to put the class library assembly into the GAC. This is recommended if you're going to share the component between applications, for example have multiple applications install the same component, but isn't actually required. The regasm utility can be made to register a class library DLL in any location using the /codebase switch; the Visual Studio deployment project's Register property, if set to 'vsdraCOM', will set the Codebase registry value appropriately if you're not installing the assembly to the GAC. If you do install the same assembly from two different locations, then uninstall one of them, the registration will be broken for the other one. That's why the GAC is recommended. If you do want to use the GAC, all assemblies that this one depends on will need to be signed and installed to the GAC as well. You can sign the DAL using the C++ linker's /KEYFILE option; you must specify this option in the 'Additional Options' field in the Linker options.

      Stability. What an interesting concept. -- Chris Maunder

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups