Issue with creating global variables in UiPath Studio

Hi,

I am getting this error when I needed to .create a global variable in UiPath Studio.
“An error has occurred while generating the global variables assembly.”

Is there any solution I can follow for this issue.
Would appreciate if someone can help me out on this.
Thank you.

@shehani.perera,

Try this solution.

Thanks,
Ashok :slight_smile:

Thank you for your response.
I have tried this solution, but the error still consists even though I have imported them.
image
Would you have any solution for this error?

@shehani.perera,

Have you imported both the namespaces?

  1. GlobalVariablesNameSpace
  2. GlobalConstantNameSpace

Thanks,
Ashok :slight_smile:

Yes I have imported both namespaces you have mentioned.
image

Thank you,
Shez

@shehani.perera,

That’s strange, try adding another workflow and check if it’s same there also. Also try creating another project for testing.

Thanks,
Ashok :slight_smile:

@shehani.perera

is this happening only in this project or all projects?

try to open the xaml in notepad and check if the required namespaces are present

cheers

I checked, it only happens with this specific project I am currently working on. I can create global variables in other projects, but I’m wondering why this issue arises only in this project. :thinking:

Thanks,
Shez

Hi,

It’s only happens in this project.
Yes It’s included.
image

Thanks,
Shez

@shehani.perera

is this a project you migrated or so?

or is built on older versions?

if no much changes better use a different project and copy the files and check

cheers

Hi,

I was using UiPath Enterprise trial version before and recently transferred to the community version.
Thanks,
Shez

@shehani.perera

may be some studio changes must have caused this

try to reopen and upgrade packages and check

if not try renaming project.json and then restore dependencies as needed and check

cheers

1 Like

@shehani.perera,

If this is still not resolved, try checking the globalVariable.json file at below location.

Thanks,
Ashok :slight_smile:

Hi,

Thank you for your response. Although the issue didn’t resolve yet, I created a new project and copied the processes into it. Sometimes, it indicate an error infront of the imported GlobalVariablesNamesapce. Could you please tell me the path, where I can access this .json file? I can’t seem to locate it within my project.

Thanks,
Shez

@shehani.perera,

It’s in hidden folder named .project. You can make it visible by clicking on filter icon in Project panel and check Show hidden folders.

image

Inside that folder you will have globalVariables.json
image

Thanks,
Ashok :slight_smile:

Hi,

I checked in the shown globalVariables.json file, but the newly created global variable isn’t shown in the code. What would I be able to do?
Thanks

@shehani.perera,

You can create it from globalVariables.json file like this.
Add Global variable from json

Once added. Save the json. Close the project and studio. Reopen it again. The variable will be reflecting in Global variable list.

Thanks,
Ashok :slight_smile: