You should reference bin\Debug\lib.dll instead of lib.dll

Hope it helps.

Jarek
----- Original Message ----- 
From: "Brian Beaudet" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 06, 2004 10:54 PM
Subject: [Nant-users] Newbie Question Regarding Referencing Assemblies


> I've got two simple *.cs files:
> 
>  
> 
> One called app.cs as shown below:
> 
>  
> 
> using System;
> 
>  
> 
>   public class App
> 
>   {
> 
>     public static void Main()
> 
>     {
> 
>       Console.WriteLine( "1 + 1 = {0}", Calculator.Add( 1, 1 ) );
> 
>     }
> 
>   }
> 
>  
> 
>  
> 
> and another called lib.cs as shown below:
> 
>  
> 
>  
> 
>   public class Calculator 
> 
>   {
> 
>     public static int Add( int x, int y )
> 
>     {
> 
>       return x + y;
> 
>     }
> 
>   }
> 
>  
> 
> and my build file called default.build looks like this:
> 
>  
> 
> <?xml version="1.0"?>
> 
> <project name="App" default="test">
> 
>     
> 
>     <property name="debug" value="true"/>
> 
>  
> 
>     <target name="clean">
> 
>             <echo message="Cleaning up..." />
> 
>         <delete>
> 
>             <fileset>
> 
>                         <includes name="binDebug" />
> 
>             </fileset>
> 
>         </delete>
> 
>     </target>
> 
>  
> 
>     <target name="prep">
> 
>       <echo message="Building output directory..." />
> 
>       <mkdir dir="binDebug" />
> 
>     </target>
> 
>  
> 
>     <target name="compile">
> 
>             <echo message="Compiling..." />
> 
>  
> 
>         <csc target="library" output="binDebug\lib.dll"
> debug="${debug}">
> 
>             <sources>
> 
>                 <includes name="lib.cs"/>
> 
>             </sources>
> 
>         </csc>    
> 
>  
> 
>         <csc target="exe" output="binDebug\app.exe" debug="${debug}">
> 
>             <sources>
> 
>                 <includes name="app.cs"/>
> 
>             </sources>
> 
>                 <references>
> 
>               <includes name="lib.dll" />
> 
>             </references>
> 
>         </csc>        
> 
>     
> 
>     </target>
> 
>  
> 
>     <target name="test" depends="clean, prep, compile">
> 
>         <exec program="binDebug\app.exe" basedir="."/>        
> 
>     </target>
> 
> </project>
> 
>  
> 
>  
> 
> However, I'm getting an error:
> 
>  
> 
> Type or namespace name 'Calculator' could not be found..etc.
> 
>  
> 
> Now, I'm using to working in VS.NET and I'm spoiled by all of the behind
> the scenes referencing that goes on.  How do I reference the Calculator
> method from a separate assembly so it runs properly in app.cs?  After
> years of having my hand held by my IDE, it would be nice really know
> what's going on.
> 
>  
> 
> Thanks.
> 
>  
> 
>  
> 
> Brian M. Beaudet
> 
> Director, Research & Development
> 
> EfficiencyLab, LLC
> 
> www.efficiencylab.com
> 
>  
> 
> 


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to