Root element is missing when create new project or open existing project

Hello

i have an issue that when i am trying to create project or open existing project i got error message root element is missing

below is log

16:10:18.3665 => [ERROR] [UiPath.Studio] [1] IScreenReaderService: raw element provider not available
16:10:18.4455 => [ERROR] [UiPath.Studio] [1] IScreenReaderService: raw element provider not available
16:10:19.6836 => [ERROR] [UiPath.Studio] [1] IScreenReaderService: raw element provider not available
16:10:20.6026 => [ERROR] [UiPath.Studio] [1] OpenAsyncInternal: System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at NuGet.Packaging.Core.NuspecCoreReaderBase.LoadXml(Stream stream, Boolean leaveStreamOpen)
at NuGet.Packaging.Core.NuspecCoreReaderBase…ctor(Stream stream, Boolean leaveStreamOpen)
at NuGet.Protocol.LocalPackageFileCache.GetNuspec(String manifestPath, String expandedPath)
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location --- at System.Lazy1.CreateValue()
at NuGet.Commands.LockFileUtils.<>c__DisplayClass2_0.b__0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy1.CreateValue() at NuGet.Commands.LockFileBuilderCache.GetLockFileTargetLibrary(RestoreTargetGraph graph, NuGetFramework framework, LocalPackageInfo localPackageInfo, String aliases, LibraryIncludeFlags libraryIncludeFlags, Func1 valueFactory)
at NuGet.Commands.LockFileBuilder.CreateLockFile(LockFile previousLockFile, PackageSpec project, IEnumerable1 targetGraphs, IReadOnlyList1 localRepositories, RemoteWalkContext context, LockFileBuilderCache lockFileBuilderCache)
at NuGet.Commands.RestoreCommand.BuildAssetsFile(LockFile existingLockFile, PackageSpec project, IEnumerable1 graphs, IReadOnlyList1 localRepositories, RemoteWalkContext contextForProject)
at NuGet.Commands.RestoreCommand.ExecuteAsync(CancellationToken token)
at UiPath.NuGet.PackageManager.InstallCore(InstallPackageCommand installCommand)
at UiPath.PackageExplorer.Core.Services.PackageInstaller.InstallWithRootPackageAssemblies(InstallPackageCommand installCommand)
at UiPath.Studio.Core.Services.Packaging.PackageOperationService.InstallWithRootPackageAssembliesAsync(InstallPackageCommand installPackageCommand)
at UiPath.Studio.Core.Services.Packaging.PackageOperationService.InstallPackage(InstallPackageCommand installPackageCommand)
at UiPath.Studio.Core.Services.Packaging.PackageOperationService.RestoreInternal(IPackageOperationBehavior packageOperationBehavior, IPackageOperationContext packageOperationContext, CancellationToken cancellationToken)
at UiPath.Studio.Core.Services.Packaging.PackageOperationService.<>c__DisplayClass37_0.<b__0>d.MoveNext()
— End of stack trace from previous location —
at UiPath.Studio.Core.Services.Packaging.PackageOperationRestoreService.Execute(IProject project, Boolean allowTargetFrameworkTemper, CancellationToken cancellationToken)
at UiPath.Studio.Core.Services.Packaging.PackageService.RestoreProjectAsync(IProject project, Boolean allowTargetFrameworkTemper, CancellationToken cancellationToken)
at UiPath.Studio.Plugin.Workflow.Shared.Project.BaseWorkflowProjectFactory.InitializeNewProjectModelInternal(String projectFilePath)
at UiPath.Studio.Plugin.Workflow.Shared.Project.BaseWorkflowProjectFactory.OpenAsyncInternal(String path, IOpenOptions options), HResult -2146232000
16:10:20.6373 => [ERROR] [UiPath.Studio] [1] Cannot open item: UiPath.Studio.Contracts.RecoverableException: The project ‘C:\Users\User.VRO-PC-53214\Downloads\Robots\Robots\05092022_EtimadExtract_TABS\project.json’ could not be opened: Root element is missing…
—> System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at NuGet.Packaging.Core.NuspecCoreReaderBase.LoadXml(Stream stream, Boolean leaveStreamOpen)
at NuGet.Packaging.Core.NuspecCoreReaderBase…ctor(Stream stream, Boolean leaveStreamOpen)
at NuGet.Protocol.LocalPackageFileCache.GetNuspec(String manifestPath, String expandedPath)
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location --- at System.Lazy1.CreateValue()
at NuGet.Commands.LockFileUtils.<>c__DisplayClass2_0.b__0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy1.CreateValue() at NuGet.Commands.LockFileBuilderCache.GetLockFileTargetLibrary(RestoreTargetGraph graph, NuGetFramework framework, LocalPackageInfo localPackageInfo, String aliases, LibraryIncludeFlags libraryIncludeFlags, Func1 valueFactory)
at NuGet.Commands.LockFileBuilder.CreateLockFile(LockFile previousLockFile, PackageSpec project, IEnumerable1 targetGraphs, IReadOnlyList1 localRepositories, RemoteWalkContext context, LockFileBuilderCache lockFileBuilderCache)
at NuGet.Commands.RestoreCommand.BuildAssetsFile(LockFile existingLockFile, PackageSpec project, IEnumerable1 graphs, IReadOnlyList1 localRepositories, RemoteWalkContext contextForProject)
at NuGet.Commands.RestoreCommand.ExecuteAsync(CancellationToken token)
at UiPath.NuGet.PackageManager.InstallCore(InstallPackageCommand installCommand)
at UiPath.PackageExplorer.Core.Services.PackageInstaller.InstallWithRootPackageAssemblies(InstallPackageCommand installCommand)
at UiPath.Studio.Core.Services.Packaging.PackageOperationService.InstallWithRootPackageAssembliesAsync(InstallPackageCommand installPackageCommand)
at UiPath.Studio.Core.Services.Packaging.PackageOperationService.InstallPackage(InstallPackageCommand installPackageCommand)
at UiPath.Studio.Core.Services.Packaging.PackageOperationService.RestoreInternal(IPackageOperationBehavior packageOperationBehavior, IPackageOperationContext packageOperationContext, CancellationToken cancellationToken)
at UiPath.Studio.Core.Services.Packaging.PackageOperationService.<>c__DisplayClass37_0.<b__0>d.MoveNext()
— End of stack trace from previous location —
at UiPath.Studio.Core.Services.Packaging.PackageOperationRestoreService.Execute(IProject project, Boolean allowTargetFrameworkTemper, CancellationToken cancellationToken)
at UiPath.Studio.Core.Services.Packaging.PackageService.RestoreProjectAsync(IProject project, Boolean allowTargetFrameworkTemper, CancellationToken cancellationToken)
at UiPath.Studio.Plugin.Workflow.Shared.Project.BaseWorkflowProjectFactory.InitializeNewProjectModelInternal(String projectFilePath)
at UiPath.Studio.Plugin.Workflow.Shared.Project.BaseWorkflowProjectFactory.OpenAsyncInternal(String path, IOpenOptions options)
at UiPath.Studio.Plugin.Workflow.Shared.Project.BaseWorkflowProjectFactory.OpenAsync(String path, IOpenOptions options)
at UiPath.Studio.Plugin.Workflow.Shared.Project.BaseWorkflowProjectFactory.OpenAsync(String path, IOpenOptions options)
at UiPath.Studio.Core.Services.PersistableServiceBase3.OnOpenAsyncInternal(String path, IFactory2 resolvedFactory, IOpenOptions options)
— End of inner exception stack trace —
at UiPath.Studio.Core.Services.PersistableServiceBase3.OnOpenAsyncInternal(String path, IFactory2 resolvedFactory, IOpenOptions options)
at UiPath.Studio.Core.CommonServices.ProjectServiceBase.OpenAsyncTaskExecute(String path, IFactory2 resolvedFactory, IOpenOptions options) at UiPath.Studio.Core.CommonServices.ProjectServiceBase.OpenAsyncTaskExecute(String path, IFactory2 resolvedFactory, IOpenOptions options)
at UiPath.Studio.Core.CommonServices.ProjectServiceBase.OnOpenAsync(String path, IFactory2 resolvedFactory, IOpenOptions options) at UiPath.Studio.Core.Services.PersistableServiceBase3.OpenAsync(OpenInformation openInfo)
at UiPath.Studio.Core.CommonServices.OpenCloseCommandsService.OpenProjectAsync(OpenInformation openInfo, IProject newProject)
at UiPath.Studio.Core.CommonServices.OpenCloseCommandsService.OpenProjectAsync(OpenInformation openInfo)
at UiPath.Studio.Core.CommonServices.OpenCloseCommandsService.OpenFileExecuteAsync(String initialDirectory, IOpenOptions options)
at UiPath.Studio.Shell.ViewModels.MainWindowViewModel.<>c__DisplayClass250_0.<b__0>d.MoveNext()
— End of stack trace from previous location —
at UiPath.Studio.Shell.ViewModels.StartPageViewModel.ExecuteCommandAsync(Func`1 commandExecute)
at UiPath.Studio.Shell.ViewModels.MainWindowViewModel.OpenAsync(Object argument), HResult -2146233088
16:10:21.5723 => [ERROR] [UiPath.Studio] [1] IScreenReaderService: raw element provider not available

please need help to over come this issue

Hello @Ala_Sinno!

It seems that you have trouble getting an answer to your question in the first 24 hours.
Let us give you a few hints and helpful links.

First, make sure you browsed through our Forum FAQ Beginner’s Guide. It will teach you what should be included in your topic.

You can check out some of our resources directly, see below:

  1. Always search first. It is the best way to quickly find your answer. Check out the image icon for that.
    Clicking the options button will let you set more specific topic search filters, i.e. only the ones with a solution.

  2. Topic that contains most common solutions with example project files can be found here.

  3. Read our official documentation where you can find a lot of information and instructions about each of our products:

  4. Watch the videos on our official YouTube channel for more visual tutorials.

  5. Meet us and our users on our Community Slack and ask your question there.

Hopefully this will let you easily find the solution/information you need. Once you have it, we would be happy if you could share your findings here and mark it as a solution. This will help other users find it in the future.

Thank you for helping us build our UiPath Community!

Cheers from your friendly
Forum_Staff

Hi,

I encountered similar issue recently.

UiPath Info
image

Error Log

22.10.3+Branch.master.Sha.def2351dc828ccfbcddb6e9e07c9cf71b5bf55da

Compilation failed or was cancelled.

project.json

{
“name”: “ImageToText3”,
“description”: “Retry ImageToText”,
“main”: “Main.xaml”,
“dependencies”: {
“UiPath.Excel.Activities”: “[2.16.0]”,
“UiPath.Mail.Activities”: “[1.18.1]”,
“UiPath.System.Activities”: “[22.10.3]”,
“UiPath.Testing.Activities”: “[22.10.0]”,
“UiPath.UIAutomation.Activities”: “[22.10.3]”
},
“webServices”: ,
“entitiesStores”: ,
“schemaVersion”: “4.0”,
“studioVersion”: “22.10.3.0”,
“projectVersion”: “1.0.0”,
“runtimeOptions”: {
“autoDispose”: false,
“netFrameworkLazyLoading”: false,
“isPausable”: true,
“isAttended”: false,
“requiresUserInteraction”: true,
“supportsPersistence”: false,
“excludedLoggedData”: [
“Private:*”,
password
],
“executionType”: “Workflow”,
“readyForPiP”: false,
“startsInPiP”: false,
“mustRestoreAllDependencies”: true,
“pipType”: “ChildSession”
},
“designOptions”: {
“projectProfile”: “Developement”,
“outputType”: “Process”,
“libraryOptions”: {
“includeOriginalXaml”: false,
“privateWorkflows”:
},
“processOptions”: {
“ignoredFiles”:
},
“fileInfoCollection”: [
{
“editingStatus”: “InProgress”,
“testCaseId”: “3d7a9a1b-c772-4588-95e4-6abe6c5f7952”,
“testCaseType”: “TestCase”,
“fileName”: “TestCase_Word_Extraction.xaml”
},
{
“editingStatus”: “InProgress”,
“testCaseId”: “0d4ff9db-cc5f-468b-8661-23f1290f13d2”,
“testCaseType”: “TestCase”,
“fileName”: “TestCase_PreProcessing.xaml”
}
],
“modernBehavior”: true
},
“expressionLanguage”: “VisualBasic”,
“entryPoints”: [
{
“filePath”: “Main.xaml”,
“uniqueId”: “be6a95a9-76b0-4aa8-b9d5-31b2a64fb3cd”,
“input”: ,
“output”:
}
],
“isTemplate”: false,
“templateProjectData”: {},
“publishData”: {},
“targetFramework”: “Windows”
}

My Observation & Testing
(1) I saved my Workflow files on an External SSD, after I moved the SSD between PCs, this error happened.
(2) project.json became blank for unknown reason.
(3) Previously functioning correctly xaml workflow file became empty in Text Editor.
(4) Error log when trying to open the aforementioned file.

22.10.3+Branch.master.Sha.def2351dc828ccfbcddb6e9e07c9cf71b5bf55da

Document is invalid

Open Document Error: UiPath.Studio.Contracts.RecoverableException
—> UiPath.Studio.Contracts.RecoverableException: The item ‘F:\UiPath\ImageToText\ImageRecognition.xaml’ could not be opened: Document is invalid.
—> RemoteException wrapping System.IO.InvalidDataException: Document is invalid
at UiPath.Studio.Plugin.Workflow.WorkflowHandling.DesignerBuilder.InitRootActivity(WorkflowDesigner designer, String filename)
at UiPath.Studio.Plugin.Workflow.WorkflowHandling.DesignerBuilder.BuildInternal(DesignerEventsSubscriber eventsSubscriber, String workflowId, String fileName)
at UiPath.Studio.Plugin.Workflow.WorkflowHandling.DesignerBuilder.Build(DesignerEventsSubscriber eventsSubscriber, String workflowId, String fileName)
at UiPath.Studio.Plugin.Workflow.WorkflowHandling.DesignerWrapper.Load(String fileName)
at UiPath.Studio.Plugin.Workflow.Services.DesignerFileProjectEndpoint.<>c__DisplayClass7_0.<b__0>d.MoveNext()
— End of stack trace from previous location —
at UiPath.Studio.Plugin.Workflow.Services.DesignerFileProjectEndpoint.<>c__DisplayClass7_0.<b__0>d.MoveNext()
— End of stack trace from previous location —
at UiPath.Studio.Shared.MVVM.Services.DispatcherService.InvokeAsync(Func1 func) at UiPath.Studio.Plugin.Workflow.Services.DesignerFileProjectEndpoint.Load(String fileName) at UiPath.CoreIpc.Server.<>c__DisplayClass7_3.<<-ctor>g__InvokeMethod|6>d.MoveNext() --- End of stack trace from previous location --- at UiPath.CoreIpc.Server.<>c__DisplayClass7_1.<<-ctor>g__HandleRequest|3>d.MoveNext() --- End of stack trace from previous location --- at UiPath.CoreIpc.Server.<>c__DisplayClass7_2.<<-ctor>b__5>d.MoveNext() --- End of stack trace from previous location --- at UiPath.CoreIpc.Helpers.Timeout[TResult](TimeSpan timeout, List1 cancellationTokens, Func2 func, String message, Func2 exceptionHandler)
— End of inner exception stack trace —
at UiPath.Studio.Core.Services.PersistableServiceBase3.OnOpenAsyncInternal(String path, IFactory2 resolvedFactory, IOpenOptions options)
at UiPath.Studio.Core.Services.PersistableServiceBase3.OnOpenAsync(String path, IFactory2 resolvedFactory, IOpenOptions options)
at UiPath.Studio.Shell.Services.DocumentService.OnOpenAsync(String path, IFactory2 resolvedFactory, IOpenOptions options) at UiPath.Studio.Core.Services.PersistableServiceBase3.OpenAsync(OpenInformation openInfo)
at UiPath.Studio.Core.CommonServices.OpenCloseCommandsService.OpenDocumentAsync(OpenInformation openInfo)
— End of inner exception stack trace —
at UiPath.Studio.Core.CommonServices.OpenCloseCommandsService.OpenDocumentAsync(OpenInformation openInfo)
at UiPath.Studio.Core.CommonServices.OpenCloseCommandsService.OpenPath(String filePath)
at UiPath.Studio.Shell.Services.ProcessArgumentsService.ProcessWithCommandLine(String commandLineFileName)
at UiPath.Studio.Shell.ShellApplication.StudioShellApplication.<>c__DisplayClass24_0.<b__0>d.MoveNext()
— End of stack trace from previous location —
at System.Threading.Tasks.Task.<>c.b__128_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 -2146233088

(5) Tried to replace project.json from a newly created project folder, as suggested in a different post (can’t remember where I found the post). Does not work.
(6) Copied and pasted the Activities/GUIs from xaml to xaml (not copying the xaml). Does not work.
(7) Has “Bad IL format” at one point.
(8) Recreate workflow file by typing manually. Error reappeared several workflow in.
(9) Removed all dependency and reinstalled again. Does not work.
(10) Can’t seem to find any working solution on the forum.

Appreciate if anyone can help.

Thanks.

Sincerely,
Jason Lai

Hi,

I think I found what my issue is.

I have backup copies of the some of the workflow files in a subfolder in the project folder. Once removed, the project can run again, ignoring the corrupted workflow file, which caused all the backups.

Thanks.

Sincerely,
Jason Lai