i am trying to include a dll within the compiled exe so that i don't need to dispatch the dll with the exe.I have seen many answers but non of them worked for me! I have added the dlltest.dll to "Reference" and modified "copy local" to False. I aslo added it to the project tree and modified the "build action" to embedded resource" (In Visual Studio)
the dlltest.cs code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace dll
{
public class Class1
{
public int sum(int a, int b)
{
int c = a + b;
return c;
}
}
}
the app.cs code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
namespace Myapp
{
public class Loader
{
static void Main(string[] argss)
{
netsum thisapp = new netsum();
}
public class netsum
{
public netsum()
{
dlltest.Class1 c = new dlltest.Class1();
Console.WriteLine(c.sum(3, 10));
Console.ReadKey();
}
}
}
}
thanks!