How does a C ++ / CLI project refer to a portable class library?

We have a bunch of C # code that references Prism.Core. Prism.Core is a portable class library. When we refer to this in C ++ / CLI and try to use the delegate command, we get:

C4691: "System :: Object": the reference value type was expected in the unreferenced assembly 'System.Runtime', the type defined in the current translation system used

Can someone explain why? And is there any way to fix, besides restoring the source, which I did not want to do, since Prism Nugeted in our C # source?

+7
c ++ c # portable-class-library prism-6
source share
1 answer

I had a similar installation with the same warning. The C # project referred to the NuGet package with several target structures. Since NuGet managed packages cannot be added to C ++ / CLI projects, a link had to be added manually for this project. The manually added link ended up in the DLL for another target structure in the NuGet package. Something like:

  CSharpProject.csproj -> packages \ Prism.Core.6.2.0 \ lib \ portable-win + net45 + wp80 + wpa81 + MonoAndroid10 + MonoTouch10 + Xamarin.iOS10 \ Prism.dll
 CppCliProject.vcxproj -> packages \ Prism.Core.6.2.0 \ lib \ net45 \ Prism.dll 

Changing the link in a C ++ / CLI project to use the same DLL as the C # project, in my case.

0
source share

All Articles