943,571 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 3288
  • C# RSS
Jan 12th, 2009
0

building dll with exe

Expand Post »
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

C# Syntax (Toggle Plain Text)
  1. // File: main.cs
  2.  
  3. using UtilityMethods;
  4.  
  5. class TestCode
  6. {
  7. static void Main(string[] args)
  8. {
  9. System.Console.WriteLine(add(2,3));
  10.  
  11.  
  12. }
  13. }

C# Syntax (Toggle Plain Text)
  1. // add.cs
  2. using System;
  3. namespace MyMethods
  4. {
  5. public class MultiplyClass
  6. {
  7. public static int add(int x, int y)
  8. {
  9. return (x+y);
  10. }
  11. }
  12. }

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
Similar Threads
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
laconstantine is offline Offline
70 posts
since May 2007
Jan 12th, 2009
0

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
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006
Jan 12th, 2009
0

Re: building dll with exe

Reputation Points: 2023
Solved Threads: 644
Senior Poster
ddanbe is offline Offline
3,735 posts
since Oct 2008
Jan 12th, 2009
0

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
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?
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
laconstantine is offline Offline
70 posts
since May 2007
Jan 12th, 2009
0

Re: building dll with exe

That would be because either you didnt add the using, or put in a fully qualified namespace path.
Reputation Points: 196
Solved Threads: 190
Posting Virtuoso
LizR is offline Offline
1,735 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: A collection of TabPages without the tabsection
Next Thread in C# Forum Timeline: Typecasting





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC