the class library name is simple
the header file is simple .h

//simple.h
#pragma once
using namespace System;
namespace simple
{
public class class1
{
public:
int addition(int x, int y);

};
}

the simple.cpp is

#include "stdafx.h"

#include "simple.h"
int addition(int x, int y)
{
return x+y;
}

then i created Visual C# console app
name dlltest
/program.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace dlltest
{
class Program
{

static void Main(string[] args)
{
simple.class1 myobject = new simple.class1.addition();
Console.Write("the sum is:{0} ",myobject.addition(2,3));
}
}
}
simple.dll added in references while debugging i'm getting errors


C:\Users\admin\Documents\Visual Studio 2008\Projects\dlltest\dlltest\Program.cs(19,56): error CS0426: The type name 'addition' does not exist in the type 'simple.class1'

C:\Users\admin\Documents\Visual Studio 2008\Projects\dlltest\dlltest\Program.cs(20,60): error CS1061: 'simple.class1' does not contain a definition for 'addition' and no extension method 'addition' accepting a first argument of type 'simple.class1' could be found (are you missing a using directive or an assembly reference?)



please help me to resolve this error.