special characters in SettingsFileGenerator.xml

Topics: Bindings File, Settings Management and SSO, Server Deployment
Dec 11, 2013 at 4:33 PM
I am working on a project that uses SettingsFileGenerator.xml to tokenize usernames and passwords. One of the passwords has an "&" in it, which is causing an error:

EXEC : error : An error occurred while parsing EntityName. Line 1, position 13064.
            C:\Program Files (x86)\Generated by ...\BizTalkDeploymentFramework.targets(653,5): error MSB3073: The command ""C:\Program Files (x86)\Generated by ...\EnvironmentSettingsExporter.exe" ... exited with code -2.
"position 13064" is the "&" in the password, and when it isn't there, there is no error.

Is there anyway to avoid this error, outside of changing the password, or leaving it out of the Generator file?

Thanks
Coordinator
Dec 11, 2013 at 5:20 PM
I just typed Strong&Password into a settings spreadsheet cell and ran an export. The export succeeded and the XML was this:

<property name="Password"><![CDATA[Strong&Password]]></property>

This is using Environment Settings Spreadsheet to XML Exporter 1.6.1.

Is that the same situation as what you are describing?

Thanks,
Tom
Dec 11, 2013 at 5:46 PM
I'm getting an error before the XML is exported.

I think the problem is the password gets pulled from a repository (KeePass) and inserted into the file using PowerShell. The & doesn't get escaped like it does if the file is saved in Excel. The result is the XML file is no longer well-formed (figured that out by viewing it with Notepad++) which is causing the error.

If I insert the password as "Strong&Password", will the exporter convert it back to "Strong&Password"?

Is there a simple way to run it through the exporter with out doing a deploy?

Thanks
Coordinator
Dec 11, 2013 at 6:58 PM
Edited Dec 11, 2013 at 7:00 PM
If the PowerShell script is modifying SettingsFileGenerator.xml and causing the XML to become invalid, then I'd say the right path of action is to fix the PowerShell script. It should be XML-escaping at least <, > and & when present inside any password.

If the Excel XML file contains
Strong&amp;Password
then yes, the exporter will convert it back to Strong&Password.

If you're in Visual Studio, you can run Tools\Deployment Framework for BizTalk\Export Environment Settings with the solution open.

Thanks,
Tom
Dec 12, 2013 at 1:42 PM
That looks like it took care of the problem, for & anyway; haven't escaped < and > yet. Thanks
Apr 22, 2016 at 3:20 PM
Hi Kris,

I having same problem of having password with &.
How did you resolve that issue ? Is you password have & ?

Thanks,
Ram
Coordinator
Apr 22, 2016 at 3:51 PM
Edited Apr 22, 2016 at 4:38 PM
Hi Ram,

Have you tried entering the password within the spreadsheet as:
Pass&amp;word
instead of
Pass&word
Thanks,
Tom
Apr 22, 2016 at 3:54 PM
In the settingsfilegenerator.xml, I replace & with &. This works for passwords, URL's, etc. I hope this helps.


​​
Chris J Albertson
President - Chris Albertson and Associates, LLC
Office/Mobile - 214.810.6271