[MSVS 2015]
I'm using MSVS 2015 and working on a C# windows phone 8.1 project through which I would like to run some C++ native code. Going off of this post here--How do I call C++/CLI from C#?--I created a C++ class library project. It's a simple, barebones thing for checking that step 0 works:
// CsCppTest.h
#pragma once
using namespace System;
namespace CsCppTest {
public ref class TestWrapper
{
public:
bool IsWorking()
{
return true;
}
};
}
I go into the project properties and under linker->input I set the Additional Dependencies property to 'Inherit from project' as per the instructions on the link I've mentioned above.
In my c# windows phone project, I haven't put in too much yet, just one line to the mainpage.xaml.cs:
public MainPage()
{
this.InitializeComponent();
this.DataContext = this;
CsCppTest.TestWrapper miner = new CsCppTest.Testwrapper();
this.NavigationCacheMode = NavigationCacheMode.Required;
}
Ah, but this can't run yet. From mainpage, it doesn't have any idea what CsCppTest.TestWrapper means. I need to add a reference to my C++ project. So I right click on my C# project's references, and in reference manager I find an unchecked box next to my C++ project, I check it, hit OK and get:
Unable to add a reference to project 'CsCppTest'.
If there are pertinent details I've forgotten to include, please let me know.
What am I missing?