Web.WebSite.Exists on Windows 7

Sep 1, 2009 at 9:34 PM

I am using the Web.WebSite.Exists function of MSBuild to check if a website in IIS7 exists. If it does not, I will copy some information into it. My issue is that, on Vista, this code works correctly, however on my Windows 7 machine, I receive many errors when attempting to build the project. (A task error has occured, Message = Unknown error 0x800050000, MachineName = localhost, etc..)

My concern is the compatibility of the MSBuild Extensions for Windows 7.

Any thoughts?

-Matt

Coordinator
Sep 1, 2009 at 9:51 PM

Hi

Could you post a sample. I seem to have CheckExists working ok on IIS7 in windows 7.

Thanks

Mike

Sep 1, 2009 at 9:53 PM

I didn't write this, so let me know if it is enough information. If not, I can get with the person who did.

<Web.WebSite.Exists Description="$(WebSiteName)">
     <Output TaskParameter="DoesExist" PropertyName="WebSiteExists"/>
</Web.WebSite.Exists>

 

Coordinator
Sep 1, 2009 at 9:59 PM

It looks like you are using the SDCTasks there, rather than the MSBuild Extension Pack tasks. The SDCTasks do not support IIS7. Take a look at the MSBuild Extension Pack IIS7 tasks here

You would use something like this

 

<MSBuild.ExtensionPack.Web.Iis7Website TaskAction="CheckExists" Name="$(WebSiteName)">
            <Output TaskParameter="Exists" PropertyName="WebSiteExists"/>
        </MSBuild.ExtensionPack.Web.Iis7Website>

Sep 2, 2009 at 2:27 PM

That worked great, thanks.