The current Wix# implementation inserts the WebSite element into Product element. Currently you have to deal with XML if you want to move it into Component element. It is relatively simple:
However, please let me know if the technique works and having the WebSite element in Component is more beneficial and I will make it an out-of-box behavior.
BTW the next release will allow simplified XML manipulations via new Xml.Linq extensions:
WebSite = new WebSite("DefaultWebSite", "*:80", "Default Web Site") { AttributesDefinition = "ConfigureIfExists=no" } ... Compiler.WixSourceGenerated += doc => { var webSite = doc.Root.Descendants().Single(x=>x.Name.LocalName == "WebSite"); var virtualDir = doc.Root.Descendants().Single(x => x.Name.LocalName == "WebVirtualDir"); webSite.Remove(); virtualDir.Parent.Add(webSite); };
BTW the next release will allow simplified XML manipulations via new Xml.Linq extensions:
project.Compiler.WixSourceGenerated + = doc => { var webSite = doc.FindSingle("WebSite"); var virtualDir = doc.FindSingle("WebVirtualDir"); webSite.MoveTo(virtualDir.Parent); };