[Interop] Call into .net/managed code from native/unmanaged code

Introduction I’ve got a native console application which would like to call into a piece of managed code written in C#. This is the how the C# function “Sum” looks like… My solution explorer looks as follows… CSharpModule is a CSharp library while TestManagedCall is a native/unmanaged project. My requirement is as follows: call Class1.Sum […]
Continue reading…

 

error LNK2022: metadata operation failed (801311E4) : Duplicate managed types have different visibilities

You will stumble upon this error if you are migrating your C++/CLI project from Visual Studio 2010 to Visual Studio 2012. One scenario for this error is when you are setting a different visibility for a native element and another include file has already set another visibility. Something like… #include <anotherinclude.h>#pragma make_public(g_SomeNativeType) Here you are […]
Continue reading…