RSS Forums RSS

building dll with exe

Please support our C# advertiser: DiscountASP.NET – 3 Months Free on C# Web Hosting
Reply
Posts: 63
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

  #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

// 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
AddThis Social Bookmark Button
Reply With Quote  
Posts: 1,867
Reputation: Ramy Mahrous has a spectacular aura about Ramy Mahrous has a spectacular aura about 
Solved Threads: 214
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Posting Virtuoso

Re: building dll with exe

  #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  
Posts: 1,213
Reputation: ddanbe is just really nice ddanbe is just really nice ddanbe is just really nice ddanbe is just really nice 
Solved Threads: 163
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Nearly a Posting Virtuoso

Re: building dll with exe

  #3  
Jan 12th, 2009
"If you judge people, you have no time to love them." Mother Teresa
Make love, no war. Cave ab homine unius libri.
First rule of debugging: "If you get a different error message, you're making progress."
Danny
Reply With Quote  
Posts: 63
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

  #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  
Posts: 1,734
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 184
LizR LizR is offline Offline
Posting Virtuoso

Re: building dll with exe

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the C# Forum
Views: 819 | Replies: 4 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 1:27 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC