3

I have a C# .NET DLL that is exposed through COM Interop for which I have generated a manifest file. The DLL is being consumed through an Excel VBAProject using CreateActCtx and CreateObject to create my objects.

Everything works fine, however... I need to call regasm MyProject.dll /codebase or register with GAC. Otherwise I get ActiveX component can't create object or error in dll errors.

Is it possible to use a .NET DLL without having to register the DLL at all? I was able to do this previously with a VB6-based DLL and a manifest file.

robodude666
  • 178
  • 1
  • 13
  • 1
    Yes, it's completely possible. The instruction are a little long so I'm just going to supply an MSDN link. https://msdn.microsoft.com/en-us/library/ms973913.aspx – jac Aug 12 '16 at 22:17
  • @Jac that's a good article but it doesn't cover a native client using a managed server, which is the OP's question. Are there any extra steps for that situation? – MarkJ Aug 17 '16 at 11:45
  • I have no experience doing this so I don't know what "gothchas" you could run into. Just that I have read plenty of times it can be done. I found this post on SO specifically for Excel VBA. Possibly this will help. http://stackoverflow.com/questions/707499/can-i-use-regfree-com-with-an-application-written-in-excel-vba – jac Aug 17 '16 at 14:35
  • @jac I've read that SO post as well. Reg-Free COM works fine with a VB6 DLL, but stops working as soon as .NET DLL is used. I've followed the SideBySide example with limited luck. I can get it to work if I call `regasm /tlb SideBySide.dll` on my computer but as soon as it runs on another it gives the same "can't create object" error. – robodude666 Aug 17 '16 at 19:53
  • Try posting your manifest files. – jac Aug 17 '16 at 20:44

0 Answers0