From 77467f9ac4d091d171fc2082f577c7d3b5b010af Mon Sep 17 00:00:00 2001 From: spitznagelk Date: Thu, 27 Apr 2017 07:08:17 -0700 Subject: [PATCH] Added a fix for Issue #70: "RevitTestFramework fails to Run If an Addin manifest is encoded in UTF-16. When run from the console using RevitTestFrameworkConsole.exe, the error message is "There is no Unicode byte order mark. Cannot switch to Unicode." There is no error message shown in the GUI." --- src/Framework/Runner/AddinHelpers.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Framework/Runner/AddinHelpers.cs b/src/Framework/Runner/AddinHelpers.cs index 60c01499..d660c07d 100644 --- a/src/Framework/Runner/AddinHelpers.cs +++ b/src/Framework/Runner/AddinHelpers.cs @@ -20,9 +20,12 @@ static class AddinHelpers public static void FullyQualifyAddinPaths (FileInfo copiedAddinFile, FileInfo originalAddin) { XmlDocument doc = new XmlDocument(); - doc.Load(copiedAddinFile.FullName); + using (StreamReader streamReader = new StreamReader(copiedAddinFile.FullName, true)) + { + doc.Load(streamReader); + } - foreach(XmlElement addinElement in doc.DocumentElement.ChildNodes) + foreach (XmlElement addinElement in doc.DocumentElement.ChildNodes) { //if this element is an addin attempt to make the assembly path a full path if (addinElement.LocalName != "AddIn")