This may or may not help you, but I've found that the mkiisdir task spits out errors if used in conjunction with the stock mmc snap-in on iis 5. The workaround is to delete the metabase node (using adsutil.vbs) before running your nant script. I actually use a two-line .bat script to setup iis for my webapp, it looks something like this:
cscript C:\Inetpub\AdminScripts\adsutil.vbs DELETE W3SVC/1/Root/MyVdirName
nant -f:project.build setup-iis
The current source for the iis tasks is visible here:
http://cvs.sourceforge.net/viewcvs.py/nantcontrib/NAntContrib/src/Tasks/Web/
Also your stack trace points to IIsTasks.cs, which I don't think has existed in cvs for a few months (more maybe? I don't quite remember). You should try upgrading to the latest version of nantContrib to see if that corrects the issue before trying anything else.
HTH,
-kb
On 8/5/05, Andrew Forward <[EMAIL PROTECTED]> wrote:
Hi,
I have attached a .doc outlining the content below - should the
formatting not be preserved in your email client.
Any help would be greatly appreciated.
andrew f
`````````
We are encountering the following issue with the mkiisdir task.
[mkiisdir] Creating/modifying virtual directory 'TempWebApp' on 'localhost:80'.
[mkiisdir] C:\temp\mkiisdir.build(4,6):
[mkiisdir] Error creating virtual directory 'TempWebApp' on 'localhost:80'.:
[mkiisdir] NAnt.Core.BuildException: C:\temp\mkiisdir.build(4,6):
[mkiisdir] Error creating virtual directory 'TempWebApp' on
'localhost:80'. ---> System.Runtime.InteropServices.COMException
(0x80005006): Exception
from HRESULT: 0x80005006.
[mkiisdir] at System.DirectoryServices.Interop.IAds.GetEx(String bstrName)
[mkiisdir] at
System.DirectoryServices.PropertyValueCollection.PopulateList()
[mkiisdir] at
System.DirectoryServices.PropertyValueCollection..ctor (DirectoryEntry
entry, String propertyName)
[mkiisdir] at
System.DirectoryServices.PropertyCollection.get_Item(String
propertyName)
[mkiisdir] at NAnt.Contrib.Tasks.MakeIISDirTask.ExecuteTask() in
C:\Documents and Settings\drieseng\Local
Settings\Temp\tmp127.tmp\src\Tasks\IISTa
sks.cs:line 797
[mkiisdir] --- End of inner exception stack trace ---
[mkiisdir] at NAnt.Contrib.Tasks.MakeIISDirTask.ExecuteTask () in
C:\Documents and Settings\drieseng\Local
Settings\Temp\tmp127.tmp\src\Tasks\IISTa
sks.cs:line 847
[mkiisdir] at NAnt.Core.Task.Execute() in C:\Documents and
Settings\drieseng\Local
Settings\Temp\tmp382.tmp\src\NAnt.Core\Task.cs:line 169
Our nant script is:
<project name="x" default="go">
<target name="go">
<mkiisdir dirpath="C:\temp" vdirname="TempWebApp"
failonerror="false" verbose="true" />
</target>
</project>
After inspecting the source code, we believe the following line of
code is at fault (we have only provided a code snippet with the
associated line number:
namespace NAnt.Contrib.Tasks {
/// <summary>
/// Base class for all IIS-related task.
/// </summary>
/// <remarks>
/// Basically this class hold the logic to determine the IIS version as well
/// as the IIS server/port determination/checking logic.
/// </remarks>
public abstract class IISTaskBase : Task {
792: if (this.Version == IISVersion.Five) {
793: <-- error newVirDir.Properties["AspThreadGateEnabled"][0] =
AspThreadGateEnabled;
794: newVirDir.Properties["AspTrackThreadingModel"][0] =
AspTrackThreadingModel;
795: }
Our machine is configured as follows:
Microsoft Windows XP
Professional
Version 2002
Service Pack 2
Microsoft Management Console 2.0
Version 5.1 (Build 2600.xpsp_sp2_gdr.050301-1519 : Service Pack 2)
Three questions,
1) Am I asking this question in the correct forum? If not, to whom
should I forward this issue?
2) Do you have any information on resolving this issue?
3) Where can we get the source code for this task? We were unable to
locate it within the NantContrib download available from
http://sourceforge.net/project/showfiles.php?group_id=54790
Thank you very much for any help,