wix意外的子元素“网站" [英] wix unexpected child element 'Website'
问题描述
使用下面的代码,一切都可以编译而没有任何错误.但是当我运行生成的 MSI 时,我没有看到在 IIS 中创建的任何站点:
With the code below, everything compiles without any error. But when I run the resulting MSI, I don't see any site created in IIS:
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:iis='http://schemas.microsoft.com/wix/IIsExtension'>
<iis:WebSite Id='dp_service_site' Description='Default Web Site'>
<iis:WebAddress Id="AllUnassigned" Port="80" />
</iis:WebSite>
.
.
<DirectoryRef Id='DPDIR'>
<Component Id='dservice' DiskId='1' Guid ='21e0c49d-e9a6-4de6-894c-d0632ea45f5a'>
<iis:WebVirtualDir Id='dp_wvd' Alias="DocumentPublisher" Directory='DPDIR' WebSite='dp_service_site'>
<iis:WebApplication Id='dp_app' Name='Default Application' WebAppPool='dp_pool' Isolation='medium'>
</iis:WebApplication>
</iis:WebVirtualDir>
<iis:WebAppPool Id='dp_pool' Identity='networkService' Name='dservice' />
</Component>
</DirectoryRef>
.
.
<Feature Id='Service' Title='Document Service' Level='1'>
<ComponentRef Id='dservice' />
</Feature>
</Wix>
<小时>
我遇到了错误.我已经按照您上面提到的方式更改了代码.我附上了截图
I am getting error. I have changed the code as per you have mentioned above. I have attached the screenshot along with this
推荐答案
我认为这里的问题是您没有在组件中创建网站,因此安装程序只是尝试查找现有网站.相反,您可能应该有这样的东西:
I believe the issue here is that you are not creating the WebSite within a component, so instead the installer is just trying to do a lookup for an existing website. Instead you should probably have something like this:
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:iis='http://schemas.microsoft.com/wix/IIsExtension'>
.
.
<DirectoryRef Id='DPDIR'>
<Component Id='dservice' DiskId='1' Guid ='21e0c49d-e9a6-4de6-894c-d0632ea45f5a'>
<iis:WebVirtualDir Id='dp_wvd' Alias="DocumentPublisher" Directory='DPDIR' WebSite='dp_service_site'>
<iis:WebApplication Id='dp_app' Name='Default Application' WebAppPool='dp_pool' Isolation='medium'>
</iis:WebApplication>
</iis:WebVirtualDir>
<iis:WebAppPool Id='dp_pool' Identity='networkService' Name='dservice' />
</Component>
<Component Id='website'>
<iis:WebSite Id='dp_service_site' Description='Default Web Site' Directory='DPDIR'>
<iis:WebAddress Id="AllUnassigned" Port="80" />
</iis:WebSite>
</Component>
</DirectoryRef>
.
.
<Feature Id='Service' Title='Document Service' Level='1'>
<ComponentRef Id='dservice' />
<ComponentRef Id'website' />
</Feature>
</Wix>
那么网站将被创建为一个单独的组件.我相信由于您指定了端口号,如果该端口上已经存在网站,那么它将修改现有网站而不是创建一个新网站.
So then the website will be created as a separate component. I believe that since you have specified a port number, if a website already exists on that port then it will modify that existing website instead of creating a new one.
更新:如错误所示,您需要将 Directory 属性添加到指向DPDIR"的 WebSite 元素.我已经更新了上面的示例.
UPDATE: As the error indicated, you need to add a Directory attribute to the WebSite element pointing to 'DPDIR'. I have updated my example above.
这篇关于wix意外的子元素“网站"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!