Unable to open XAML file due to UNEXPECTED END OF FILE error

I had a critical issue that I’ve never encountered before and there is nothing I can find about it on UiPath forum.
While working on the workflow my UiPath crashed and now I am unable to open my main workflow where are 3 weeks worth of work.

The error message I’m getting when I try to open it is following:
21.4.4+Branch.master.Sha.a8b5101efe02651274064093e9c7410fedff7696

Unexpected end of file has occurred. The following elements are not closed: sap:WorkflowViewStateService.ViewState, ui:ForEachRow, Sequence, ActivityAction, ui:OpenBrowser.Body, ui:OpenBrowser, Sequence, ui:CommentOut.Body, ui:CommentOut, Transition.Action, Transition, State.Transitions, State, Transition.To, Transition, State.Transitions, State, StateMachine, Sequence, ActivityAction, ui:ForEachRow.Body, ui:ForEachRow, FlowStep, FlowStep.Next, FlowStep, Flowchart, Activity. Line 5559, position 32.

Error: System.Xml.XmlException: Unexpected end of file has occurred. The following elements are not closed: sap:WorkflowViewStateService.ViewState, ui:ForEachRow, Sequence, ActivityAction, ui:OpenBrowser.Body, ui:OpenBrowser, Sequence, ui:CommentOut.Body, ui:CommentOut, Transition.Action, Transition, State.Transitions, State, Transition.To, Transition, State.Transitions, State, StateMachine, Sequence, ActivityAction, ui:ForEachRow.Body, ui:ForEachRow, FlowStep, FlowStep.Next, FlowStep, Flowchart, Activity. Line 5559, position 32.

  • at System.Xml.XmlTextReaderImpl.Throw(Exception e)*
  • at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)*
  • at System.Xml.XmlTextReaderImpl.ThrowUnclosedElements()*
  • at System.Xml.XmlTextReaderImpl.ParseElementContent()*
  • at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)*
  • at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)*
  • at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)*
  • at System.Xml.Linq.XDocument.Load(String uri)*
  • at UiPath.Studio.Plugin.Workflow.Document.XamlDocumentReader.ReadAsync(String path)*
  • at UiPath.Studio.Core.Services.PersistableServiceBase`3.GetFactoryByPath(String path)*
  • at UiPath.Studio.Core.Services.PersistableServiceBase`3.ResolveFactory(OpenInformation openInfo)*
  • at UiPath.Studio.Core.Services.PersistableServiceBase`3.OpenAsync(OpenInformation openInfo)*
  • at UiPath.Studio.Shell.ViewModels.Project.Behaviors.FileProjectItemBehavior.ExecuteOpenAsync(IFileSystemProjectItemViewModel item)*
  • at UiPath.Studio.App.Desktop.MVVM.Commands.TaskCommand`3.Execute(TExecuteParameter parameter, Boolean ignoreCanExecuteCheck)*
  • at System.Threading.Tasks.Task.<>c.b__140_0(Object state)*
  • at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)*
  • at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler), HResult -2146232000*

I will greatly apprecate assistance on this issue. Otherwise I will lose all the work I’ve done so far :c
Please can someone help me? :frowning:

Hi @nacho

Please try this:

  1. open UiPath Studio or X or Pro
  2. create a new (empty or blank) project
  3. import your workflow
  4. examine your output panel and add missing dependencies

image

Thank you for your suggestion.
I was unable to go past step 3. UiPath failed to import workflow due to same error I have presented in this topic.
I have also checked the Line 5559, position 32 by opening XAML file as TXT but that line is blank, it’s the last line in the file that doesn’t contain anything