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

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

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?

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.