DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C# (http://www.daniweb.com/forums/forum61.html)
-   -   building dll with exe (http://www.daniweb.com/forums/thread167816.html)

laconstantine Jan 12th, 2009 3:27 am
building dll with exe
 
listen i got to compile one file to a dll and one to an exe
all in one project

so i got 1 file called


main.cs

// File: main.cs

using UtilityMethods;

class TestCode
{
    static void Main(string[] args)
    {
        System.Console.WriteLine(add(2,3));

     
    }
}

// add.cs
using System;
namespace MyMethods
{
  public class MultiplyClass
  {
      public static int add(int x, int y)
      {
        return (x+y);
      }
  }
}

when i compile i am getting only the exe file and not the dll
so i cant use the dll funcs!!

i am using visual C# express

can anybody help me with this one???

i heard i have to add some command but i have no idea where to add it and what command i am freaked off


help me lol please

Ramy Mahrous Jan 12th, 2009 3:35 am
Re: building dll with exe
 
You create 1 solution holds your 2 project (exe and dll)
From your (exe) project add reference to your dll project then press Ctr + F5

ddanbe Jan 12th, 2009 7:15 am
Re: building dll with exe
 
REading this will help http://www.c-sharpcorner.com/UploadF...058AM/dll.aspx

laconstantine Jan 12th, 2009 12:10 pm
Re: building dll with exe
 
Quote:

Originally Posted by RamyMahrous (Post 776336)
You create 1 solution holds your 2 project (exe and dll)
From your (exe) project add reference to your dll project then press Ctr + F5

ok its helped

but now i am getting an error at my main func

"The name 'add' does not exist in the current context"

any ideas?

LizR Jan 12th, 2009 12:21 pm
Re: building dll with exe
 
That would be because either you didnt add the using, or put in a fully qualified namespace path.


All times are GMT -4. The time now is 3:07 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC