Hi Jody,
 
I'm not sure where you found that information, but Function and FunctionSet have not been replaced.
 
For an example, you can always check out the custom functions that are part of the NAnt distibution.
 
eg. http://cvs.sourceforge.net/viewcvs.py/nant/nant/src/NAnt.Core/Functions/BooleanFunctions.cs?rev=1.1&view=markup
 
Here's an example of an inline function that checks whether a given assembly is deployed in BizTalk:
 
<script language="C#" prefix="biztalk">
    <references basedir="${path::combine(bts.install.dir, 'Developer Tools')}">
        <include name="Microsoft.BizTalk.ExplorerOM.dll" />
    </references>
    <imports>
        <import namespace="Microsoft.BizTalk.ExplorerOM" />
    </imports>
    <code>
        <![CDATA[
            [Function("is-assembly-deployed")]
            public bool IsAssemblyDeployed(string server, string mgmtDb, string assemblyName) {
                BtsCatalogExplorer ce = new BtsCatalogExplorer();
                ce.ConnectionString = "Integrated Security=SSPI;" +
                    "database=" + mgmtDb + ";server=" + server;
                return (ce.Assemblies[assemblyName] != null);
            }
        ]]>
    </code>
</script>
<echo message="Deployed: ${biztalk::is-assembly-deployed('myServer', 'myDb', 'AnAssemblyName')}" />
 
Hope this helps,
 
Gert
 
 
----- Original Message -----
From: "Jody Williams" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, March 07, 2006 3:08 AM
Subject: [NAnt-users] C# custom function

I've just started using NAnt, and the documentation I've found on
writing custom functions seems to be out of date. It looks like
FunctionSet and Function have been replaced. I thought I found the
correct replacements, but when I try to copy my .dll to the nant
directory and call the function from a build file, I get the message
"property <my function set> has not been set".

 

Does anyone have a C#  example that works with nant-0.85-rc3 they could
share? If there are any other instructions for making the custom
function available to build files, I'd appreciate those, too.

 

Thanks,

 

Jody

Reply via email to