Is there any way to load unmanaged dll during design-time in visual studio?
I know that I can always place the DLL in the “System32” folder or add the Dll path to the “PATH” variable to load it directly. But I dont want to do that. I want to load it from the ExecutablePath of the Application. The DLL actually holds a control.
Can anyone help me with this situation??
Thanks,
WritZ
That cannot work, there isn’t one yet. Other than Windows never looking there, the designer is guaranteed to fail when you check-in from source control or clean the project.
This code runs in the context of Visual Studio so Windows DLL search rules are based on its install location. It isn’t clear whether this is pinvoke code that’s failing or if your assembly has an implicit dependency on the DLL. You can do something about pinvoke, you can prevent code running by testing the DesignMode property. The only way to deal with an implicit dependency is helping Windows find the DLL. A directory on the search path. The only way forward then is to split code into the parts that only really matter at design mode so DesignMode becomes useful again.