Could not load file or assembly Dotspatial

673 Views Asked by At

I am creating a user control that uses DotSpatial 1.7. Also, I created a windows form app to test my control. When I reference "DotSpatial" dll files, "Copy Local" is set to true and the control works well. However, when I set "Copy Local" to false, I get the error below:

Additional information: Could not load file or assembly 'DotSpatial.Controls, Version=1.7.0.0, Culture=neutral, PublicKeyToken=4d9e49339a7d240c' or one of its dependencies. The system cannot find the file specified.

How solve this to copy all dlls in my control dll and do not copy in app folder?

1

There are 1 best solutions below

0
On

I believe that DotSpatial components are not, by default, deployed with an installer or distributed in a way that would automatically register the libraries with the GAC (Global Assembly Cache). In order to set copy local to false, the application needs to be able to find the libraries in the GAC. You will need to make sure the libraries have strong names if they do not already. If you are building the DotSpatial dll files from source, you would need to create an InstallShield Limited Edition Project as described in this Microsoft doc or else run the Global Assembly Cache Tool (Gacutil.exe). The tool is recommended to be used only for development purposes.