Web task- AddBinding - doesn't seem to work as expected

Jan 8, 2008 at 11:59 AM
Hi,

I'm trying to run the Web AddBinding task to add a binding for a website on my local machine to a host entry in my hosts file. However, this returns the following error:

c:\MyProject.proj(6,5): error : A task error has occured.
c:\MyProject.proj(6,5): error : Message = Could not load website from given DirectoryEntry
c:\MyProject.proj(6,5): error : Description = MyWebsite
c:\MyProject.proj(6,5): error : IPAddress = <String.Empty>
c:\MyProject.proj(6,5): error : Port = 80
c:\MyProject.proj(6,5): error : Secure = False
c:\MyProject.proj(6,5): error : HostName = newbinding.mydomain.com
c:\MyProject.proj(6,5): error : Identifier = <String.Empty>
c:\MyProject.proj(6,5): error :
c:\MyProject.proj(6,5): error : at Microsoft.Sdc.Tasks.Configuration.Web.WebSite..ctor(DirectoryEntr
ebsite)
c:\MyProject.proj(6,5): error : at Microsoft.Sdc.Tasks.Configuration.Web.WebSite.Load(String machine
e, Int32 identifier)
c:\MyProject.proj(6,5): error : at Microsoft.Sdc.Tasks.Web.WebSite.AddBinding.InternalExecute()
c:\MyProject.proj(6,5): error : at Microsoft.Sdc.Tasks.TaskBase.Execute()The RPC server is unavailable

This error is followed up by:

c:\MyProject.proj(6,5): error : A task error has occured.
c:\MyProject.proj(6,5): error : Message = Could not load website from given DirectoryEntry
c:\MyProject.proj(6,5): error : Description = MyWebsite
c:\MyProject.proj(6,5): error : IPAddress = <String.Empty>
c:\MyProject.proj(6,5): error : Port = 80
c:\MyProject.proj(6,5): error : Secure = False
c:\MyProject.proj(6,5): error : HostName = newbinding.mydomain.com
c:\MyProject.proj(6,5): error : Identifier = <String.Empty>

Having had a look through the source code, it seems that the task is trying to load the website by hostname, using the 'newbinding.mydomain.com' hostname as supplied as the argument to the AddBinding task. However, the hostname argument to the AddBinding task is the name I want to bind the website to, rather than the name of the website I want to act on. Or am I misunderstanding how the AddBinding task is meant to work?

If I'm correct and this is indeed not the expected behaviour, I'd be happy to open a new issue and attach a patch so that the AddBinding takes an additional 'hostheader' parameter which would be bound to the site described in the 'hostname' parameter.

Thanks,
Nick
Developer
May 17, 2008 at 3:52 PM
Hi Nick

Can you try this with the latest release. As far as I can see, the task is using the description to load the website. The sample in the help file is working for me:

  <Target Name="Default">
           <Web.WebSite.AddBinding
               Description="mytestsite"
               IPAddress="10.0.0.1"
               Port="80"
               HostName="hostname.example"
               Secure="false"/>
  </Target>
Nov 20, 2008 at 11:37 PM
Hi,

I've been using the latest release and can see that the description maps to the right website.

However I get an "Access is Denied" error. I'm a local admin on the box. Do you know if I need any special permission to be able to do this?

Thanks,

Glen