Note that there are some explanatory texts on larger screens.

plurals
  1. POCombining C++/CLI, x86, x64 and strong naming
    primarykey
    data
    text
    <p>Let me get right to the point:</p> <p><strong>Main application:</strong></p> <p>C# (4.0), AnyCPU.</p> <p><strong>Library:</strong></p> <p>Wrapper for native .dll written in C++/CLI. Compiled in two versions; x86 and x64, both signed with the same .snk key (using <a href="http://blogs.msdn.com/b/vcblog/archive/2011/03/11/10140139.aspx" rel="nofollow noreferrer">this</a> workaround)</p> <p><strong>Limitations:</strong></p> <p>In the end a single distribution package is required for x86 and x64 platforms. Main application needs strong name due to references to other strongly named libs. Rewriting the library using managed C# and P/Invoke is an absolute last way out.</p> <p><strong>The problem:</strong></p> <p>As long as the main application, at compile time, references the version (x86 or x64) of the library that is needed when run, this is all working fine.</p> <p>Moving the same compiled output - and exchanging the library with the right platform version during installation - does not work since the signature of the library changes from that of the referenced one.</p> <p>In a test application without any strong naming I can switch between them as needed.</p> <p><strong>The question:</strong></p> <p>Is there a way to enable switching between the x86 and x64 libraries within the set limitations, or is strong naming preventing any possible solution other than rewriting the lib?</p> <p>Let me clarify that it is not a question about finding the correct .dll (as discussed <a href="https://stackoverflow.com/questions/108971/using-side-by-side-assemblies-to-load-the-x64-or-x32-version-of-a-dll/156024#156024">here</a>) but about being able to load the .dll once found.</p>
    singulars
    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.
 

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