Need help with error - new uipath user

i keep getting this error:
Error ERROR Validation Error Cannot access a disposed object.
Object name: ‘52f52f9e-b2b0-4613-987c-c269365cdf6b’. Main.xaml


1 Like

Hi @richygeorge

Welcome to our UiPath Forum! :slight_smile:

When does this error happen? Could you provide more details?

When i try to run the bot. In debug mode it runs just fine.

Could you share details of your process?

i am creating a robot that does parallel activities of uploading data from an excel file to a web form and to a local desktop crm application.

so i created 3 xaml files - web data, crm data, and main.
i just finished creating the bot for the web data upload. When i run the bot it runs fine. But when i try the regular run mode it generates this error.

hi forum staff,
I have also got the same problem as richygeorge.
I believed we are following the same training video (ie. Complete UiPath RPA Developer course build 7 robots) and now we are at the robot 2 exercise.
In this exercise, we are creating 2 additional .xaml file and rename it to ‘web data.xaml’ and another ‘CRM data.xaml’
Then we use the ‘web data.xaml’ and read the excel sheet, then call out the browser, and call out ‘while’ activity and use the ‘type into’ to the web browser.
Initialy I could still see the robot type into the browser. But when I try again there is this error “cannot access a disposed object” which will occur at the main.xaml and also at the CRM data.xaml.
I want to upload my files but new user cannot upload attachment.
Hope someone can help us.

thank u


i just realise when I run the debug/run file, then it is able to do the input of data from excel to the website.
But when I click on debug/run or debug/debug, it will have the error of “cannot access dispose object”.
can someone please help.
thanks a lot in advance (63.9 KB)

hi forum staff,
this is my file as attached.
I use the file “web data.xaml”. When I click on “debug/run file” it will be fine. But when I click on “debug/run”, it will call out the main file and have the error msg of “cannot access dispose object.”
thanks a lot in advance.

I encountered this error myself, but was able to fix it by simply restarting Studio :thinking:

1 Like

yes but the problem persists when you try to run it again. I have tried restarting uipath, my laptop etc. but the problem reappears.

1 Like

@ah_boon i think i figured it out.

When you click “RUN” the “main.xaml” file runs. Since there is nothing in the “Main.xaml” file yet, it gives you an error. So you have to click “Run file” which runs the current .xaml file you are working on.

Once you have content in the Main.xaml file you can click run and it will work.

i assume this is an update to the uipath interface from Leon Petrou’s interface in the udemy course since he is using an older version of UiPath.

i think i figured it out.

When you click “RUN” the “main.xaml” file runs. Since there is nothing in the “Main.xaml” file yet, it gives you an error. So you have to click “Run file” which runs the current .xaml file you are working on.

Although it is a working workaround, we would like to dig deeper into the root cause of the issue.

Let me summarize a bit.

This suggests that something corrupted your Main.xaml file (it’s the one that throws the exception, and this is why it doesn’t work when you run the entire process). It’s confirmed by the red dot next to it:

@richygeorge Could you maybe share the entire project via a private message as well?


Is there anything specific that you did that caused this error to occur?

For example, does the error disappear when you open the untouched course material once again?

1 Like

i dont mind sharing the project at all.

i have completed the robot now with content in the main.xaml. Now the “RUN” function works fine. i assume because when the main.xaml is invoked there is content for it to use?

i am very new to uipath. so i am making some assumptions.

yes you can have the project. tell me how to share it with you.

yeah u re right. I have to click “debug file and run file” for the .xaml file to run.
Other option such as “Debug file and debug” or “debug file and run” will trigger the other .xaml file and cause some error…

@loginerror, @richygeorge
when I am at a xaml file and want to click on “Debug file and debug” or “debug file and run”, it will trigger the other .xaml files and cause some error…
attached are my files. (54.0 KB)

Hello ,
I experienced the same issue. and was able to resolve it by opening WebData.xaml file in notepad and updating the x:Class="WebData value. class was set to “Main”. because, initially, we copy/paste Main.xaml file and renamed it to WebData.xaml. but never updated the class value… please let me know your thoughts.

there is a separate issue with chrome browser prompting error if private mode is checked. it works in IE though with private checked. switched to IE for now.