Empty path name is not legal in global variable

Hi,

I am trying to create a global variable but it is giving error viz “empty path name is not legal”.
Can someone pls help me in this.

Thanx in advance.

Hi @Riya_Bansal

Can you confirm if these are imported?

Globalconstantsnamespace and globalvariablesnamespace

And also did you install any package from market place?

Because as per namespace I see there is a different library its looking for.

Can you also confirm which version of system packages and studio are you using

Cheers

Hi @Anil_G

Can you confirm if these are imported? → yes these two(Globalconstantsnamespace and globalvariablesnamespace) are imported

And also did you install any package from market place?–> No

version of studio–> 2022.10.3

@Riya_Bansal

Can you check if you have created any variable with same name in the variables panel or in arguments panel… you can search using search on top to search all files

If not then can you downgrade the system packages version and check

And is the error coming soo after you start the process? Or on any specific activity? Because generally we see path empty for any files related activities if you are doing any

Cheers

@Anil_G
which package do i need to downgrade?

@Riya_Bansal

Uipath.system.activities - please downgrade and check

Can you confirm when you are getting this error

Cheers

@Anil_G

it’s still not working…
Can you confirm when you are getting this error–> while setting the variable scope to global

Hi @Riya_Bansal

Can you create a new project and see if you are facing the same issue?

If so can you share the xaml you have issue with?

Alternately, close all projects and uipath studio and try deleting the uipath.system.activities folder from the following location C:\Users\Username.nuget\packages\uipath.system.activities . Then reopen and create a global variable and check

Cheers

@Anil_G
tried creating another workflow file it is still not working…

@Riya_Bansal

Can you share a sample workflow that you built here please. So that we can validate on our side

Cheers

test.zip (5.3 KB)

@Anil_G

pls find attached file.

Attaching logs also:

Error: System.Exception: Empty path name is not legal.
at System.IO.Strategies.FileStreamHelpers.ValidateArguments(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
at Roslyn.Utilities.StandardFileSystem.OpenFile(String filePath, FileMode mode, FileAccess access, FileShare share)
at Roslyn.Utilities.CommonCompilerFileSystemExtensions.OpenFileWithNormalizedException(ICommonCompilerFileSystem fileSystem, String filePath, FileMode fileMode, FileAccess fileAccess, FileShare fileShare)
at UiPath.Studio.Plugin.Workflow.GlobalVariables.GlobalVariablesCompiler.<>c__DisplayClass13_0.b__2(String location)
at UiPath.Shared.Extensions.CollectionExtensions.ForEach[TItem](IEnumerable1 collection, Action1 action)
at UiPath.Studio.Plugin.Workflow.GlobalVariables.GlobalVariablesCompiler.GetMetadataReferences(IEnumerable1 dependencies) at UiPath.Studio.Plugin.Workflow.GlobalVariables.VisualBasicGlobalVariablesCompiler.CreateCompilation(String assemblyName, IEnumerable1 syntaxTrees, IEnumerable1 dependencies) at UiPath.Studio.Plugin.Workflow.GlobalVariables.GlobalVariablesCompiler.Run(IEnumerable1 globalVariables, String outputDirectory, String assemblyName, String& assemblyPath)
at UiPath.Studio.Workflow.GlobalVariables.GlobalVariablesAssemblyManager.GenerateAssembly(ExpressionLanguage language, String projectDirectory, IEnumerable1 variables, String& assemblyPath) at UiPath.Studio.Workflow.GlobalVariables.GlobalVariablesAssemblyManager.GenerateCorrespondingAssembly(ExpressionLanguage language, String projectDirectory, IEnumerable1 variables)
at UiPath.Studio.Plugin.Workflow.GlobalVariables.GlobalVariablesInstallerProjectService.InstallInternal(String projectDirectory, ExpressionLanguage expressionLanguage, String assemblyPath, IEnumerable1 variables) at UiPath.Studio.Plugin.Workflow.GlobalVariables.GlobalVariablesInstallerProjectService.Install(String projectDirectory, ExpressionLanguage expressionLanguage, IEnumerable1 variables)
at UiPath.Studio.Plugin.Workflow.GlobalVariables.GlobalVariablesProjectEndpoint.OnGlobalVariablesChanged(IEnumerable1 variables) at UiPath.Studio.Plugin.Workflow.GlobalVariables.GlobalVariablesProjectEndpoint.StoreVariables(IEnumerable1 variables)
at UiPath.Studio.Plugin.Workflow.Business.DataManager.Services.GlobalVariablesDesignerService.StoreGlobalVariablesWithValidDefaultValuesOnly()
at UiPath.Studio.Plugin.Workflow.Business.DataManager.Services.GlobalVariablesDesignerService.GlobalDesigner_ModelChanged(Object sender, EventArgs e)
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 -2147024809

Hi @Riya_Bansal

I see a MongoDB package which is creating the issue for you. Removing that I am able to create global variables. I also tried upgrading it, still is throwing the error but I am able to , but if you want to use global variables then create the variables by removing the package and then install the mongodb package again and you should be able to use the global variables as well. Looks like there is some dependency issues getting created with MongoDB package for global variables

cheers

@Anil_G

Is there any other way to use variable in other sequence apart from passing arguments.
As passing variable one by one to all the sequences is becoming very typical activity for me, as there are more than 130 variables which needs to be passed in 10+ sequences.

Hi @Riya_Bansal

You have other option of setting them to assets and use them but it has its own limitations. Another way is to write to excel and read them always which again has its limitations

Did you try creating the required global variables and then installing the mongodb package that way you can use the global variables and you need not go with any other approach

cheers

yes i tried it, but it’s not working either.

Hi @Riya_Bansal

Can you check it properly please as I able to create and use them in the same workflow

cheers

removed package viz mongodb.driver
also removed all its imports. but it’s still not working for me.

@Riya_Bansal

Did you try the above?

And did you try creating a new project instead of new xaml in same project?

cheers

yes tried this as well.

@Riya_Bansal

Can you try with this sample xaml that I modified please

test.zip (11.4 KB)

So I believe you even deleted the systems package folder from the provided location

cheers