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

New Post: Can't get a simple .Net 4 bootstrap to work.

$
0
0
> ...Yes, I can confirm the file is present.
This problem is solved now thank's. It turns out that the exception "System.Xml.XmlException: The prefix '' cannot be redefined from..." is triggered by the same XML serialization flaw, which fails a simple XElement.ToString() if the element has namespace reassigned. I didn't believe my eyes at first but a simple code below will always throw the exception and return false:
staticbool IsSettingNamespaceSafe()
{
    var doc = XDocument.Parse(@"<Root xmlns=""http://www.test.com/xml/2015"">
                                    <Element xmlns=""""/>
                                </Root>");
    var xml = doc.ToString();

    XNamespace ns = doc.Root.Name.NamespaceName;

    var e = doc.Root.Elements().First();
    e.Name = ns + e.Name.LocalName;

    try
    {
        xml = doc.ToString();
        returntrue;
    }
    catch
    {
        returnfalse;
    }
}
Thus the XDocument based namespace normalization algorithm is replaced now with a simple XML string manipulation.

> Have I bitten off more than I can chew?
I don't know. May be. :o)

I am not really sure what's going on there but I do know that a simple project created from the VS Wix# Bootstrapper template implements exactly your scenario. Web-based .NET4.0 installer and native MSI UI. I just tested it and it behaves as expected.

Unfortunately I am not an expert in this specific field and I cannot give you a 'killer' advise. But I would start from the reviewing and comparing the XMLs generated by the default bootstrapper project I mentioned and the one produced by your code.

Good luck.

Viewing all articles
Browse latest Browse all 1354

Trending Articles



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