Library compiling error with JObject type of argument

Hi,

I tried to create Library that includes workflow with Newtonsoft.Json.Linq.JObject type of argument. When I try to publish that Library, there comes compiling error (sorry about finnish language, but “kohteessa” means used file/class/etc.);

Unexpected error has occured during the library compilation process:
System.ArgumentException: Object of type ‘System.Activities.InArgument1[Newtonsoft.Json.Linq.JObject]' cannot be converted to type 'System.Activities.InArgument1[Newtonsoft.Json.Linq.JObject]’.
kohteessa System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
kohteessa System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
kohteessa System.Reflection.MethodBase.CheckArguments(Object parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
kohteessa System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
kohteessa System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
kohteessa System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object index, CultureInfo culture)
kohteessa System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object index)
kohteessa UiPath.ActivityCompiler.XamlGeneration.XamlGenerator.GenerateXaml(ActivityBuilder builder, Type fakeType, Boolean needCurrentDirectoryResolver)
kohteessa UiPath.ActivityCompiler.Compiler.XamlCompiler.CompileXaml(WorkflowDocument document, ActivityBuilder activityBuilder, IList1 dynamicReferences) kohteessa UiPath.ActivityCompiler.Compiler.XamlCompiler.<>c__DisplayClass8_1.<Compile>b__4() kohteessa UiPath.ActivityCompiler.Logging.LoggingScope.Execute() kohteessa UiPath.ActivityCompiler.Logging.LoggingManager.ExecuteDocumentCompiler(Action action, XamlCompilerOptions options, WorkflowDocument wfDocument, Int32 index) kohteessa UiPath.ActivityCompiler.Compiler.XamlCompiler.<>c__DisplayClass8_0.<Compile>b__1() kohteessa UiPath.ActivityCompiler.Logging.LoggingScope.Execute() kohteessa UiPath.ActivityCompiler.Logging.LoggingManager.ExecuteDocumentsCompiler(Action action) kohteessa UiPath.ActivityCompiler.Compiler.XamlCompiler.Compile() kohteessa UiPath.ActivityCompiler.CommandLine.Program.<>c__DisplayClass4_1.<RunCompiler>b__2() kohteessa UiPath.ActivityCompiler.Logging.LoggingScope.Execute() kohteessa UiPath.ActivityCompiler.Logging.LoggingManager.ExecuteXamlCompiler(Action action) kohteessa UiPath.ActivityCompiler.CommandLine.Program.<>c__DisplayClass4_1.<RunCompiler>b__0() kohteessa UiPath.ActivityCompiler.Logging.LoggingScope.Execute() kohteessa UiPath.ActivityCompiler.Logging.LoggingManager.ExecuteRunCompiler(Action action) kohteessa UiPath.ActivityCompiler.CommandLine.Program.RunCompiler(CompilerOptions programArgs, Boolean fromStudio) kohteessa UiPath.ActivityCompiler.CommandLine.Program.RunCompilerWithFile(StudioOptions opts) kohteessa UiPath.ActivityCompiler.CommandLine.Program.<>c.<Main>b__2_2(StudioOptions opts) kohteessa CommandLine.ParserResultExtensions.MapResult[T1,T2,T3,TResult](ParserResult1 result, Func2 parsedFunc1, Func2 parsedFunc2, Func2 parsedFunc3, Func2 notParsedFunc)
kohteessa UiPath.ActivityCompiler.CommandLine.Program.<>c__DisplayClass2_0.b__0()

Anyone has noticed same or does UiPath has something to comment about this issue?

Problem was related to my custom NuGet package which included custom DLL but also Newtonsoft DLL. I removed Newtonsoft DLL from NuGet package and now compiling works.

2 Likes

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