Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use several options - if you know in advance where the assembly will be located, you can add that path to your application's configuration file:</p> <pre><code>&lt;configuration&gt; &lt;runtime&gt; &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt; &lt;probing privatePath="MyPath"/&gt; &lt;/assemblyBinding&gt; &lt;/runtime&gt; &lt;/configuration&gt; </code></pre> <p>If you want to search for the assembly at runtime, you can implement a handler for <code>AppDomain::CurrentDomain-&gt;AssemblyResolve</code> event:</p> <pre><code>ref class AssemblyResolver { public: /// The path where the assemblies are searched property String^ Path { String^ get() { return path_; } } explicit AssemblyResolver(String^ path) : path_(path) { /* Void */ } Assembly^ ResolveHandler(Object^ sender, ResolveEventArgs^ args) { // The name passed here contains other information as well String^ dll_name = args-&gt;Name-&gt;Substring(0, args-&gt;Name-&gt;IndexOf(',')); String^ path = System::IO::Path::Combine(path_, dll_name+".dll"); if ( File::Exists(path) ) return Assembly::LoadFile(path); return nullptr; } private: String^ path_; }; </code></pre> <p>and you can wire it using something like this:</p> <pre><code>AssemblyResolver^ resolver = gcnew AssemblyResolver(path); AppDomain::CurrentDomain-&gt;AssemblyResolve += gcnew ResolveEventHandler( resolver, &amp;AssemblyResolver::ResolveHandler ); </code></pre> <p>Just make sure this is done before calling any methods that may use types from the assembly that has to be resolved.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload