building dll with exe

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2007
Posts: 69
Reputation: laconstantine is an unknown quantity at this point 
Solved Threads: 1
laconstantine laconstantine is offline Offline
Junior Poster in Training

building dll with exe

 
0
  #1
Jan 12th, 2009
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

  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. }

  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
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: building dll with exe

 
0
  #2
Jan 12th, 2009
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
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,908
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 273
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Posting Virtuoso

Re: building dll with exe

 
0
  #3
Jan 12th, 2009
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 69
Reputation: laconstantine is an unknown quantity at this point 
Solved Threads: 1
laconstantine laconstantine is offline Offline
Junior Poster in Training

Re: building dll with exe

 
0
  #4
Jan 12th, 2009
Originally Posted by RamyMahrous View Post
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?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: building dll with exe

 
0
  #5
Jan 12th, 2009
That would be because either you didnt add the using, or put in a fully qualified namespace path.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC