1

I would like to know where the ProductCode (GUID) of an autoloading DLL for AutoCAD is coming from. I have developed a plugin in DLL that has some commands for AutoCAD. I follow a "known good" example program and create a bundle for my plugin. The DLL failed to autoload for some reason. I am wondering may be the ProductCode (GUID) that I have entered in PackageContents.xml is wrong. That's why I want to find out the correct way to find a ProductCode.

Based on the example program, I am sure that the ProductCode is NOT the GUID stated in section in the Visual Studio project file. And I am also sure that the ProductCode is NOT the GUID stored in AssemblyInfo.cs file either.

Should I use the GUID inside the DLL file? But I have no way to tell which GUID is embedded inside the DLL file.

As of now, I simply use the GUID generated using Visual Studio --> Tools --> Create GUID. But I don't know if this is the right GUID to use. Or does this really matter which GUID to use as long as it is unique?

Please help. Thanks.

Jay Chan

Jay C
  • 141
  • 1
  • 12
  • If this is a .NET dll, personally I have been using the registry for autoloading, and found it really easy to set up with no issues. [See here](https://stackoverflow.com/a/46897472/7159784). There are some links you can follow in the post that explain how to set up the registry. I hope that helps. – Nik Oct 18 '18 at 21:24
  • Thanks for your link to a web page that shows many different ways to autoload. That is a "keeper". Anyway, this is a different topic. For my question here, I am interested to know where you get your GUID. I suppose when you use your way to register your plugin for AutoCAD, you will need to enter a GUID into the registry, right? Where do you get that GUID? Do you get it through Visual Studio --> Tools --> Create GUID? Please let me know. – Jay C Oct 19 '18 at 11:57
  • No, you do not need the GUID for that, just a path to your dll. It is quite easy, here's a [direct link](https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/How-to-autoload-DLLs-with-AutoCAD.html). Scroll down to "Solution B". I am not saying this is the best solution, I am saying that it has worked well for me! – Nik Oct 20 '18 at 00:29
  • Thanks for explaining that I don't need a GUID when I register the DLL. Just an off-topic question: I assume you use a script to add your settings into the registry, and I assume you use regasm.exe to run the script. Which version of regasm.exe that you use to register your DLL/EXE? regasm.exe is not in the search PATH. There are multiple copies of regasm.exe in various folders under C:\Windows\Microsoft.NET\Framework. – Jay C Oct 22 '18 at 12:00

1 Answers1

2

When you create a new PackageContents.xml file for your bundle, you have to create a new GUID (menu Tools > Create a Guid) as ProductCode and an another one as UpgradeCode, then, for each new version of your application, you should create a new GUID for the ProductCode but never change the UpgradeCode one. If you also build an installer (Windows Installer), a good practice is to set the same GUIDs for ProductCode and UpgradeCode in the PackageContents as those generated by VisualStudio for the installer. More details about Autoloader here: http://adndevblog.typepad.com/autocad/2013/01/autodesk-autoloader-white-paper.html

gileCAD
  • 2,295
  • 1
  • 10
  • 10
  • Thanks for the reply. Yes, I understand that I need a GUID in PackageContents.xml, and I am glad to hear that you have confirmed that the GUID is the one that I get from Tools --> Create Guid. This is what I need to know. – Jay C Oct 22 '18 at 11:49