954,153 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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

laconstantine
Junior Poster in Training
70 posts since May 2007
Reputation Points: 10
Solved Threads: 1
 

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

Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276
 
ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
 
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?

laconstantine
Junior Poster in Training
70 posts since May 2007
Reputation Points: 10
Solved Threads: 1
 

That would be because either you didnt add the using, or put in a fully qualified namespace path.

LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You