Plugin won't load in debugger (customer db)
Plugin won't load in debugger (customer db)
I am trying to debug a customer's db that uses our plugin.
I copy the customer's db into my mysql/data folder but the plugin won't load when I try to run OD in the VS2019 debugger. Why?
I copy the customer's db into my mysql/data folder but the plugin won't load when I try to run OD in the VS2019 debugger. Why?
Cheers,
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Re: Plugin won't load in debugger (customer db)
Hey there,
What is your typical process for creating your debugging environment? Which version of Open Dental are you trying to do this with, and have you been successful with pervious versions?
Lastly, what sort of output/error message display when Visual Studio fails to build in DEBUG mode?
What is your typical process for creating your debugging environment? Which version of Open Dental are you trying to do this with, and have you been successful with pervious versions?
Lastly, what sort of output/error message display when Visual Studio fails to build in DEBUG mode?
Re: Plugin won't load in debugger (customer db)
I can build OK. It's OD 22.1.55.
Further investigation shows that it's failing here on PluginLoader.cs (see arrow):
Does it need to be whitelisted at HQ somehow? The plugin loads just fine in that office's production environment, and on my development database on my development server, but it won't load on a copied database from my customer.
Further investigation shows that it's failing here on PluginLoader.cs (see arrow):
Code: Select all
public static void LoadAllPlugins(Form host) {
if(Environment.MachineName.ToLower()=="jordanhome" || Environment.MachineName.ToLower()=="jordancryo"){
bool isAllowed=DatabaseIntegrities.IsPluginAllowed("someplugin.dll");//to simulate loading a dll
}
//No need to check RemotingRole; no call to db.
if(ODBuild.IsWeb()) {
return;//plugins not allowed in cloud mode
}
List<PluginContainer> listPluginContainers=new List<PluginContainer>();
//Loop through all programs that are enabled with a plug-in dll name set.
List<Program> listPrograms=Programs.GetWhere(x => x.Enabled && !string.IsNullOrEmpty(x.PluginDllName));
for(int i=0;i<listPrograms.Count;i++) {
string dllPath=ODFileUtils.CombinePaths(Application.StartupPath,listPrograms[i].PluginDllName);
if(RemotingClient.RemotingRole==RemotingRole.ServerWeb) {
dllPath=ODFileUtils.CombinePaths(System.Web.HttpContext.Current.Server.MapPath(null),listPrograms[i].PluginDllName);
}
---------------------> if(!DatabaseIntegrities.IsPluginAllowed(listPrograms[i].PluginDllName)){
DatabaseIntegrity databaseIntegrity=DatabaseIntegrities.GetOnePlugin(listPrograms[i].PluginDllName);
Cheers,
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Re: Plugin won't load in debugger (customer db)
NVM, I was able to find a workaround:
Just replacing the code in DatabaseIntegrities.Refresh from HQ like so worked.
Just replacing the code in DatabaseIntegrities.Refresh from HQ like so worked.
Code: Select all
private static void RefreshFromHQ(){
_listDatabaseIntegrities=new List<DatabaseIntegrity>();
#if DEBUG
----------------------> //OpenDental.localhost.Service1 service1=new OpenDental.localhost.Service1();
#else
OpenDental.customerUpdates.Service1 service1=new OpenDental.customerUpdates.Service1();
service1.Url=PrefC.GetString(PrefName.UpdateServerAddress);
#endif
----------------------> OpenDental.customerUpdates.Service1 service1 = new OpenDental.customerUpdates.Service1();
Cheers,
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Re: Plugin won't load in debugger (customer db)
Edit: I am glad you found a work around. I am leaving the below information in case others find it useful.
Yes, as of 21.4 all plugins must be whitelisted here at Open Dental HQ. However, if the dental office is able to use your plugin, it is already whitelisted. This whitelisting check is based on the exact match of the dll name, so the filename of the dll you are testing must be the same as the one used by the dental office. I have just verified that we have a Big Idea Software plugin whitelisted, but you are welcome to private message me the exact name of your desired dll to verify specifically.
Could you please clarify if the solution is throwing at the point indicated at the arrow, or if you are seeing a message box when starting Open Dental stating plugins were unable to be loaded?
Yes, as of 21.4 all plugins must be whitelisted here at Open Dental HQ. However, if the dental office is able to use your plugin, it is already whitelisted. This whitelisting check is based on the exact match of the dll name, so the filename of the dll you are testing must be the same as the one used by the dental office. I have just verified that we have a Big Idea Software plugin whitelisted, but you are welcome to private message me the exact name of your desired dll to verify specifically.
Could you please clarify if the solution is throwing at the point indicated at the arrow, or if you are seeing a message box when starting Open Dental stating plugins were unable to be loaded?
Re: Plugin won't load in debugger (customer db)
I don't see any error window it just silently fails and won't load the plugin.
Cheers,
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Re: Plugin won't load in debugger (customer db)
We have code like this sprinkled throughout the program on purpose; So that we don't automatically connect to our live services when we are developing. Your users should never run into this problem since they should be using a version of Open Dental that was compiled in Release mode.
The best thing about a boolean is even if you are wrong, you are only off by a bit.
Jason Salmon
Open Dental Software
http://www.opendental.com
Jason Salmon
Open Dental Software
http://www.opendental.com
Re: Plugin won't load in debugger (customer db)
OK thanks.
Not the end of the world, but definitely annoying
Not the end of the world, but definitely annoying

Cheers,
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA