Calling an Embedded Toolbox - Get executing Assembly Location

04-29-2021 09:01 AM
New Contributor II


I have been following the instructions here, to embed a toolbox and it works fine for embedding.

I have been using the code snippet that I found at the end of this post by  to reference the embedded toolbox.

However, this code returns a path with  the assembly location. like this


and it needs to be 


I have modified my code, to replace the string "AssemblyCache" and this works, but is there a cleaner way to do this? my code is below

string assemblyfolderpath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string finalpath = assemblyfolderpath.Replace("AssemblyCache", "Toolboxes");
string tool_path = System.IO.Path.Combine(finalpath,@"toolboxes\Default.tbx\CreateScenario");

Thank you in advance for your help



0 Kudos
1 Reply
New Contributor

After trying to resolve this for a while i found that once you have embedded the toolbox you can access it like a system toolbox, i.e  <toolboxName>.<toolName> you dont need to know its full path

0 Kudos