This project is read-only.

Web.WebSite.Exists on Windows 7

Sep 1, 2009 at 10: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?


Sep 1, 2009 at 10:51 PM


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



Sep 1, 2009 at 10: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"/>


Sep 1, 2009 at 10: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"/>

Sep 2, 2009 at 3:27 PM

That worked great, thanks.