tags:

views:

153

answers:

2

I'm trying to bring a C++ library into C#, so naturally I am trying to make a C++/CLI project.

In visual studio I created a new project (Visual C++ project, class library). I then tried to make a test class out of the pre-generated "Class1"

namespace Test {

    public ref class TestIt
    {
    public:
        void DoWork()
        {
            System::Console::WriteLine("sup");
        }
        // TODO: Add your methods for this class here.
    };
}

So I compile in and go to the build folder.... hrmm no .dll wetf?? There's a .dll.intermediate.manifest file, but no .dll.

So wut I did wrong?

+2  A: 

This is going to require some psychic debugging. Or a web cam. I'll guess that you added this project to an existing solution. In which case you'll find the DLL in the Debug subdirectory of the solution folder, not the Debug folder of your project.

To get it in the right place, right-click the project that needs the DLL, Add Reference, Project tab, select your C++/CLI project. Now it will get copied in the bin\Debug folder of your C# project, ready for your C# project to use it.

Hans Passant
Awww yea, color me a noob... =)
Bad Man
A: 

You can create a new CLR dll type solution, within your current project file. Compile, and you'll get a dll file.

au9ustine