I believe that this is related to:
https://sourceforge.net/tracker/index.php?func=detail&aid=1284206&group_id=54790&atid=474851
At any rate, I have a machine which hosts several websites, ci.blah.com for CruiseControl.NET, mike.blah.com for my bookmarks and such, build.blah.com for the latest build, etc.
I have a rather simple build target which I'm trying to execute in order to determine why I can't modify anything in the IIS metabase. The target looks like this:
<target name="test">
<loadtasks assembly="C:\ContinuousIntegration\NAntContrib-0.85\bin\NAnt.Contrib.Tasks.dll" />
<mkiisdir website="build.blah.com" dirpath="C:\Install Files\" vdirname="/" authanonymous="false" />
<deliisdir website="build.blah.com" vdirname="/" />
</target>
So the idea there is that it'll create a website with the root at a folder which holds files I download and install. I used:
<mkiisdir iisserver="svc.here.dev" dirpath="D:\Develop\Here" vdirname="/" authanonymous="false"/>
at http://nantcontrib.sourceforge.net/release/0.85-rc2/help/tasks/mkiisdir.html as a kind of template for this particular target. I'm getting the following error:
The website named 'build.blah.com' does not exist.
The longer error is:
<buildresults project="USGM_NAnt"><message level="Info"><![CDATA[Buildfile: file:///C:/ContinuousIntegration/USGM_2/build/Config/nant_config.xml]]></message><message level="Info"><![CDATA[Target framework: Microsoft .NET Framework 2.0]]></message><message level="Info"><![CDATA[Target(s) specified: test]]></message><task name="property"><duration>0</duration></task><target name="test"><task name="loadtasks"><message level="Info"><![CDATA[Scanning assembly "NAnt.Contrib.Tasks" for extensions.]]></message><duration>187.5</duration></task><task name="mkiisdir"><message level="Info"><![CDATA[Creating/modifying virtual directory '' on 'localhost:80' (website: build.blah.com).]]></message><duration>546.875</duration></task><duration>750</duration></target><failure><builderror><type>NAnt.Core.BuildException</type><message><![CDATA[The website named 'build.blah.com' does not exist.]]></message><location><filename>C:\ContinuousIntegration\USGM_2\build\Config\nant_config.xml</filename><linenumber>19</linenumber><columnnumber>6</columnnumber></location><stacktrace><![CDATA[ at NAnt.Contrib.Tasks.Web.WebBase.FindServerInstance()
at NAnt.Contrib.Tasks.Web.WebBase.CheckIISSettings()
at NAnt.Contrib.Tasks.Web.CreateVirtualDirectory.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()]]></stacktrace></builderror></failure><duration>796.875</duration></buildresults>
Under the IIS Metabase console the website shows up as build.blah.com and has the additional host headers to respond to build.blah.com. I've also tried modifying the name to simply build, while keeping the host headers.
This machine has two IPs, one a private 10.x.x.x for the hosting company's intranet and a public one, 65.x.x.x. The current configuration has the website bound to "(All Unassigned)" rather than a specific IP, however I've also tried assigning it to a specific IP with the same results.
I'm not 100% sure that this is a bug within NAntContrib, it may simply be that my configuration is incorrect.
If that is the case, then the only "bug" is in the documentation: i.e. not giving an example of how to work with one of several websites all hosted on the same machine. I'd love for someone to straighten me out. If anyone could point me to someone to do a bit of consultancy work I'd be much obliged.
If its not a problem with my configuration, then please let me know if there is any other information that could help with solving this problem. I'm very eager to get a continuous integration server up and running and I'll do whatever I can to help with this potential bug.
Thanks,
Mike
Logged In: YES
user_id=2003720
Originator: NO
Hi, Mike!
I had the same problem as you. I investigated the issue and luckily I found a solution.
I changed only one sign in NAnt.Contrib.Tasks.Web.WebBase.FindServerInstance() method.
Before the change:
int maxBindingPriority = 0;
After the change:
int maxBindingPriority = -1;
It is an important change in looking for given website. There is a loop which proceeds all websites on a webserver. For each website a bindingPriority is calculated, then it is compared to the maxBindingPriority.
if (bindingPriority <= maxBindingPriority) {
continue;
}
The point is the bindingPriority is in most cases equal 0, see NAnt.Contrib.Tasks.Web.WebBase.BindingPriority(string binding) method for details. Before the change it headed to continue operator very often and skipped following comparison a current website to the given by user in mkiisdir task.
Best regards,
Maciej Ciara, Globema
Logged In: YES
user_id=2003720
Originator: NO
Hi, Mike!
I had the same problem as you. I investigated the issue and luckily I found a solution.
I changed only one sign in NAnt.Contrib.Tasks.Web.WebBase.FindServerInstance() method.
Before the change:
int maxBindingPriority = 0;
After the change:
int maxBindingPriority = -1;
It is an important change in looking for given website. There is a loop which proceeds all websites on a webserver. For each website a bindingPriority is calculated, then it is compared to the maxBindingPriority.
if (bindingPriority <= maxBindingPriority) {
continue;
}
The point is the bindingPriority is in most cases equal 0, see NAnt.Contrib.Tasks.Web.WebBase.BindingPriority(string binding) method for details. Before the change it headed to continue operator very often and skipped following comparison a current website to the given by user in mkiisdir task.
Best regards,
Maciej Ciara, Globema