Quantcast
Channel: wixsharp Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1354

New Post: Can't run code once upgrading from 1.0.7.0 to 1.0.41.0

$
0
0
Don't worry about the project I see now the problem you are trying to solve. It looks like you are trying to set an action condition. This is what wasn't clear for me.

> Why CDATA has been removed from conditions by default?
I am not sure Wix# ever used CData by default for all WiX types/elements. (Though may be I just don't remember).
Anyway, currently Wix# checks if the Condition value has any XML delimiter and encodes it as a CData if any detected. However it looks like in your case the detection algorithm failed and Wix# missed that fact that your Condition interferes with XML encoding. That is why I really need to know what was your condition value that did not trigger the CData encoding.

> ...It looks like for example, that document.Root.Select("Product") returns a value, but can't reach:...
Correct. You are using XDocument Element to access it and most likely it can be only accessed with use of proper XML namespaces. Anyway, I always encourage users to use Wix# XML extensions for accessing the elements transparently by the "local names". The syntax that you were looking for is as follows:
staticvoid Project_WixSourceGenerated(XDocument document)
{
    var element = document.Root.Select("Product/InstallExecuteSequence")
                                .FindAll("Custom")
                                .First(x => x.Value == "MY_CONDITION");

    element.ReplaceNodes(new Condition("<your condition>").ToCData());
}
However in your case you don't have to do XML injection as you can force CData encoding in a more direct way:
AutoElements.ForceCDataForConditions = true;
As for the auto detection of CData triggering conditions I will proceed with the fix when I have a sample of the "offending" Condition value.

Viewing all articles
Browse latest Browse all 1354

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>