是否支持C ++/CLI项目引用.net核心dll?
问题描述:
C ++/CLI项目可以引用使用.net核心创建的类库吗?
Can C++/CLI project reference class library which is created using .net core?
引用.net核心类库的C ++/CLI项目(包装器)将成功构建.使用包装器的C ++客户端也将生成.但是,在运行时,将引发以下错误:" System.TypeLoadException:可以 不会从程序集"System.Private.CoreLib"中加载类型"System.Object",因为父级不存在. 请告知我是否支持这种引用.
The C++/CLI project (wrapper) which references .net core class library will build successfully. The C++ client which consumes the wrapper will also build. But, at runtime, the following error is thrown: "System.TypeLoadException: Could not load type 'System.Object' from assembly 'System.Private.CoreLib' because the parent does not exist". Please let me know if such referencing is supported.
答
截至24天前,
As of 24 days ago, no. More specifically you cannot target .NET Standard 1.x using C++/CLI. However with the .NET framework supporting .NET Standard 2.0 you might be able to, once it is released.