本文介绍了托管C ++和值为anycpu的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个托管C ++ DLL,我从一个C#项目引用。 C#的项目将被编译为值为anycpu。有没有什么办法来编译32位和64位版本的托管C ++ DLL,然后告诉C#项目在运行时加载正确的,这取决于它的架构正在运行?

I have a Managed C++ dll that I am referencing from a C# project. The C# project will be compiled as AnyCPU. Is there any way to compile a 32-bit and 64-bit version of the Managed C++ dll and then tell the C# project at runtime to load the correct one depending on which architecture it is being run?

推荐答案

的讨论一个复杂的方式来做到这一点,看看Stefan的评论,讨论一个更简单适用于某些应用程序的方法。

This article discusses a complex way to do it, and see Stefan's comment that discusses a much simpler methods that applies to some applications.

这篇关于托管C ++和值为anycpu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 01:11