.Net Core中的C ++ / CLI支持 [英] C++/CLI Support in .Net Core

查看:265
本文介绍了.Net Core中的C ++ / CLI支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的项目结构是,

native.dll :-其中包含用c编写的纯本机代码\c ++。
此native.dll使用* def文件公开一些功能。

native.dll :- This contains pure native code written in c\c++. This native.dll exposes some functions using *def file.

包装器库(使用.Net Framework v4编译的wrapper.dll。 0):-
为了使用 native.dll 的功能,需要使用 Wrapper lib(wrapper。 dll)
使用:clr\oldsyntax C ++ \CLI 编写c>。该包装器具有所有
代码,分别是互操作性封送处理

Wrapper Library(wrapper.dll compiled with .Net framework v4.0) :- In order to use functionality of native.dll, a Wrapper lib(wrapper.dll) is written in C++\CLI using :clr\oldsyntax. This wrapper has all code of Interoperability and Marshalling.

Application(Console App v4.0)直接使用 wrapper.dll 来使用$ b提供的功能$ b由 native.dll 创建。

Application(Console App v4.0) directly uses wrapper.dll to use functionality provided by native.dll.

现在,该项目需要在 .Net Core 中运行。这意味着我们将拥有一个
.Net Core应用程序,该应用程序将 reference wrapper.dll 请参考
native.dll

Now this project needs to run in .Net Core. This means we will have an .Net Core application that will reference wrapper.dll that in turn will refer native.dll.

我知道这将无法直接工作。但是问题是 .Net Core(CoreCLR)是否支持
C ++ \CLI(clr\oldsyntax)运行时环境

I know this will not directly work. But the issue is whether .Net Core(CoreCLR) supports C++\CLI (clr\oldsyntax) runtime environment ?

如果否,该应用程序可能有什么解决方案?

推荐答案


.Net Core(CoreCLR)是否支持C ++ \CLI(clr\oldsyntax)运行时环境?

whether .Net Core(CoreCLR) supports C++\CLI (clr\oldsyntax) runtime environment ?

据我所知,有没有计划通过.NET Core支持C ++ / CLI


如果没有,该应用程序可能的解决方案是什么? / p>

If no, what can be the possible solutions to this application work ?

您可以(应该)提供C API。 单声道。 G。支持P / Invoke (另请参阅此堆栈溢出问题与DllMap相关的票证)。

You can (should) provide a C API. Mono e. g. supports P/Invoke and .NET Core also supports P/Invoke (see also this Stack overflow question and this DllMap related ticket).

这篇关于.Net Core中的C ++ / CLI支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆