System.ArgumentNullException: Value cannot be null

Hi All,

I created a Library that has been working fine and I recently upgraded Orchestrator to 2019.10.16 and Studio to 2019.10.3 and I have made some changes to it and I am trying to publish it and I am getting the following error:

Unexpected error has occurred during the library compilation process:

System.AggregateException: One or more errors occurred. β€”> System.ArgumentNullException: Value cannot be null.Parameter name: node
at Microsoft.CodeAnalysis.SeparatedSyntaxList1.Insert(Int32 index, TNode node) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToCollectionLiteral(IEnumerable enumerable, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToCollectionLiteral(IEnumerable enumerable, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToCollectionLiteral(IEnumerable enumerable, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToCollectionLiteral(IEnumerable enumerable, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToCollectionLiteral(IEnumerable enumerable, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToCollectionLiteral(IEnumerable enumerable, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook) at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter) at UiPath.ActivityCompiler.CSharpCompiler.ActivityFactory.BuildActivityFactoryMethod(ActivityBuilder builder, Hook hook) at UiPath.ActivityCompiler.CSharpCompiler.ActivityFactory.<Build>d__7.MoveNext() at UiPath.ActivityCompiler.CSharpCompiler.LibraryFactory.<>c__DisplayClass5_0.<Build>b__1(Int32 _) at System.Threading.Tasks.Parallel.<>c__DisplayClass17_01.b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.b__0(Object )
β€” End of inner exception stack trace β€”
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally) at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action1 body)
at UiPath.ActivityCompiler.CSharpCompiler.LibraryFactory.Build(GenerateLibraryRequest generateLibraryRequest)
at UiPath.ActivityCompiler.CommandLine.Program.<>c__DisplayClass5_1.b__1()
at UiPath.ActivityCompiler.Logging.LoggingScope.Execute()
at UiPath.ActivityCompiler.Logging.LoggingManager.ExecuteCSharpDocumentsCompiler(Action action)
at UiPath.ActivityCompiler.CommandLine.Program.<>c__DisplayClass5_0.b__0()
at UiPath.ActivityCompiler.Logging.LoggingScope.Execute()
at UiPath.ActivityCompiler.Logging.LoggingManager.ExecuteCSharpCompiler(Action action)
at UiPath.ActivityCompiler.CommandLine.Program.ExecuteCSharpCompiler(CompilerOptions programArgs, List1 documents) at UiPath.ActivityCompiler.CommandLine.Program.<>c__DisplayClass4_1.<RunCompiler>b__0() at UiPath.ActivityCompiler.Logging.LoggingScope.Execute() at UiPath.ActivityCompiler.Logging.LoggingManager.ExecuteRunCompiler(Action action) at UiPath.ActivityCompiler.CommandLine.Program.RunCompiler(CompilerOptions programArgs) at UiPath.ActivityCompiler.CommandLine.Program.RunCompilerWithFile(StudioOptions opts) at UiPath.ActivityCompiler.CommandLine.Program.<>c.<Main>b__2_2(StudioOptions opts) at CommandLine.ParserResultExtensions.MapResult[T1,T2,TResult](ParserResult1 result, Func2 parsedFunc1, Func2 parsedFunc2, Func2 notParsedFunc) at UiPath.ActivityCompiler.CommandLine.Program.<>c__DisplayClass2_0.<Main>b__0() ---> (Inner Exception #0) System.ArgumentNullException: Value cannot be null. Parameter name: node at Microsoft.CodeAnalysis.SeparatedSyntaxList1.Insert(Int32 index, TNode node)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToCollectionLiteral(IEnumerable enumerable, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToCollectionLiteral(IEnumerable enumerable, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToCollectionLiteral(IEnumerable enumerable, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToCollectionLiteral(IEnumerable enumerable, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToCollectionLiteral(IEnumerable enumerable, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToCollectionLiteral(IEnumerable enumerable, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.ToInlineObjectLiteral(Object obj, ObjectFactoryContext context, Hook hook)
at UiPath.ActivityCompiler.CSharpCompiler.ObjectFactory.GetFactorySyntax(Object value, ObjectFactoryContext context, Hook hook, Boolean hasSetter)
at UiPath.ActivityCompiler.CSharpCompiler.ActivityFactory.BuildActivityFactoryMethod(ActivityBuilder builder, Hook hook)
at UiPath.ActivityCompiler.CSharpCompiler.ActivityFactory.d__7.MoveNext()
at UiPath.ActivityCompiler.CSharpCompiler.LibraryFactory.<>c__DisplayClass5_0.b__1(Int32 _)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.b__0(Object )<β€”

I have searched the forums and I can see people have had similar errors before but I have tried what they have suggested to no effect. Can anyone help me to know where abouts I should be looking for this issue?

I can see that something is not being set correctly, and Parameter is the node but I cannot find what that means anywhere.

Your help is greatly appreciated or a direction to look in!

Hi,

Quick Update - I have disabled every Invoke workflow activity in the entire library and added default Argument values to every argument and I still cannot get it to compile.

I then realised I was using a Microsoft package - Workflow Manager Activities so I just removed any activity that used this and the package itself and still I cannot get it to compile.

I cannot see what Studio is having an issue with as the error is so vague. Going to log it with the technical support team as I do not know what else I can do or than potentially downgrading my Studio version back to 2019.4.4

Hello @Gerard_McNamara_Ged. Please check out Updated Studio from 2019.10.2 to 2019.10.3 Community and now I have a null reference error on my Custom Library - #11 by ClaytonM.
You can either update to 2019.10.4 or switch the compiler.

1 Like

Upgraded and it is working as expected. Thankyou

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.