-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AddDefaultNamespaces removing processing instructions #1667
Comments
Can you please give me the example of "processing instructions that were injected earlier"? |
Im trying to inject my own edited version of this file using the Compiler.WixSourceGenerated event: It has this segment:
but when AddDefaultNamespaces gets called the |
Great, thank you. Will check it on weekend |
OK, I see. And when I debugged your use-case I saw the non-compliant tags removed on injection even before they reached WixSharp. They are removed by the .NET XDocument API: You can even try to trick the system by forcing the non-compliant tags but While changing the parsing to Thus it's more beneficial to rely on transparent fully debuggable XML manipulation techniques that every C# dev is familiar with. Even though I prefer to do it even without project.AddWixFragment("Wix/Product", XElement.Parse(@"
<Feature Id=""BinaryOnlyFeature"" Title=""Sample Product Feature"" Level=""1"">
<ComponentRef Id=""Component.myapp_exe"" />
</Feature>"));
project.AddXml("Wix/Product", "<Property Id=\"Title\" Value=\"Properties Test\" />");
project.AddXmlElement("Wix/Product", "Property", "Id=Gritting; Value=Hello World!");
Compiler.WixSourceGenerated += document =>
{
// merge 'Wix/Product' elements of document with 'Wix/Product' elements of CommonProperies.wxs
document.InjectWxs("CommonProperies.wxs");
. . . |
Basically I was trying to take the Wix UI code as is from their libs and include it in my project with some minor changes (through the WixSourceGenerated event and adding only the fragments). I have since got this working using project.WxsFiles.Add which seems to be the more appropriate way to do what I want. If you are interested in supporting XProcessingInstruction injected through WixSourceGenerated though, I confirmed that changing this code fixed my issue:
|
As someone new to Wix, Wix# has been a lifesaver by the way. Great work! |
Great, glad it helped you :) |
Fantastic. Your change makes perfect sense. |
The call to AddDefaultNamespaces in BuildWxs seems to strip processing instructions that were injected earlier
The text was updated successfully, but these errors were encountered: