0

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

4
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by LizR
0

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

0

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?

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.