In this blog post, we will look at a few common setup related issues that can cause problems in running your RealDWG application.
System.IO.FileNotFoundException : This exception get thrown usually because your RealDwg Application does not find the dependent dlls. To ensure your RealDwg application accesses the right DLLs is to create an installer for your application with all the dependencies and then installing your application in a clean test machine and test it. But, for testing purposes during development, you can place your RealDWG application in the RealDWG root folder and test it. It is easier to simply set the build output path in the Visual Studio solution to place the output in the RealDWG root folder.
Also, ensure that the [RealDWG root path], [RealDWG root path]\Fonts and [RealDWG root path]\Support folder paths are added to the system's PATH environment variable. You may need to restart Visual Studio if you made the environment variable change when Visual Studio was open.
System.InvalidProgramException : RealDWG SDK has two versions of acdbmgd.dll just as the ObjectARX SDK does. The dll in RealDWG 2016\Inc folder has its executable code removed and the one in the RealDWG root folder is the unmodified dll. When referencing the "acdbmgd.dll" in your VisualStudio project from the Inc folder, remember to set "Copy Local" property to false for the reference. This is to prevent Visual Studio from replacing the "acdbmgd.dll" in the RealDWG root folder with the one found in "Inc" folder. If this happens, your application can throw a System.InvalidProgramException and the only way to fix it would be to find the "acdbmgd.dll" from the RealDWG install CD and copy it to the RealDWG root folder.