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
|
- Re: [Nant-users] Newbie Question Regarding Referencing A... Brian Beaudet
- Re: [Nant-users] Newbie Question Regarding Referenc... Jaroslaw Kowalski
- RE: [Nant-users] Newbie Question Regarding Referenc... Noel Gifford
- RE: [Nant-users] Newbie Question Regarding Referenc... Noel Gifford