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.
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')}" />
<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
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
