I am trying to debug a Revit design automation bundle like in this tutorial:
https://www.youtube.com/watch?v=i0LJ9JOpKMQ
using these repositories:
https://github.com/Autodesk-Forge/design.automation-csharp-revit.local.debug.tool https://github.com/Autodesk-Forge/learn.forge.designautomation
I am getting this error:
System.Xml.XmlException HResult=0x80131940 Message=There is no Unicode byte order mark. Cannot switch to Unicode. Source=System.Xml StackTrace:
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.CheckEncoding(String newEncodingName)
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl) at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlReader.MoveToContent()
at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XElement.Load(String uri, LoadOptions options)
at DesignAutomationHandler.DesignAutomationHandlerApp.Execute(ExternalCommandData commandData, String& message, ElementSet elements) in C:\Users\CALS079313\source\repos\debug_design_automation_addin\design.automation-csharp-revit.local.debug.tool-master\DesignAutomationHandler.cs:line 22
at apiManagedExecuteCommand(AString* assemblyName, AString* className, AString* vendorDescription, MFCApp* pMFCApp, DBView* pDBView, AString* message, Set<ElementId,std::less<ElementId>,tnallc<ElementId> >* ids, Map<AString,AString,std::less<AString>,tnallc<std::pair<AString const ,AString> > >* data, AString* exceptionName, AString* exceptionMessage)
I tried to change the code
XElement addin = XElement.Load(file);
to this:
XElement addin;
using (FileStream stream = new FileStream(file, FileMode.Open, FileAccess.Read))
{
XmlReaderSettings settings = new XmlReaderSettings { CheckCharacters = false };
using (XmlReader reader = XmlReader.Create(stream, settings))
{
addin = XElement.Load(reader);
}
}
but nothing, I got the same error...
I tried to do the same steps from the tutorial but got that error.