cancel
Showing results for 
Search instead for 
Did you mean: 

C# Code Stage with Data Type Dynamic

StefanSchnell1
Level 7
Hello Community,
I tried to use in a C# Code Stage the data type dynamic, but it doesn't work.
Here my example to reproduce the behavior.
36489.png

This error occurs: Compiler-Error in line 4: Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'
As far as I can see it is compiler error CS0656.

Now my tiny question: Is it generally possible to use the C# data type dynamic in a Code Stage?

Thanks and best regards
Stefan
1 BEST ANSWER

Best Answers

ewilson
Staff
Staff
@StefanSchnell1,

Interesting. It may have something to do with some of the other libraries I've loaded in that test process, or it could be related to the BP version. Which version of Blue Prism are you running? I'm on BP v6.9.

Cheers,

View answer in original post

10 REPLIES 10

ewilson
Staff
Staff
Hi @StefanSchnell1,

You should be able to do this, but you will need to add a reference to the correct DLL and namespace in the Initialise​ action of your VBO.

36479.png
Cheers,

StefanSchnell1
Level 7
Hello @ewilson,
thank you very much for your answer.
I had tried that, but unfortunately without success:
36480.png

36481.png

​Could it be possible that is dependently from the dotNET version?
Thanks and best regards
Stefan

ewilson
Staff
Staff
@StefanSchnell1,

I believe the dynamic data type was added in .NET 4.5. What version of the framework are you using?

Cheers,

StefanSchnell1
Level 7
Hello @ewilson,

thanks for your fast reply.
36482.png


The dotNET version is 4.8.

Thanks and best regards
Stefan

ewilson
Staff
Staff
@StefanSchnell1,

Interesting. It may have something to do with some of the other libraries I've loaded in that test process, or it could be related to the BP version. Which version of Blue Prism are you running? I'm on BP v6.9.

Cheers,

StefanSchnell1
Level 7
Hello @ewilson,
thank you very much for your tip to analyze other libraries. Yes, it is the library System.Core.dll which is also still required.
Now everything works well.
Best regards
Stefan
36483.png

NivedN
Level 3
Hi @StefanSchnell1 , @ewilson

I am also facing the same issue

even i tried with the methods being suggested here , the same error still persists.

code i used :
dynamic data = JsonConvert.DeserializeObject(data_in);
new_confirmed = data.Global.NewConfirmed.ToString();


External Refernces and namespace imports

36484.png




Also .net framework version is 4.8,

please help to solve the issue
​​​​

StefanSchnell1
Level 7

@NivedN

Hello Nived,

unfortunately I can not comprehend your problem.

36487.jpg

36488.jpg


​In my case all works as expected.

Best regards
Stefan

NivedN
Level 3
Hi @StefanSchnell1

Same thing i had also done, but the error is still existing
 error while checking the code

Page: Parsing the json
Stage: Code1
Type: Error
Action: Validate
Description: Compiler error at line 2: Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'
Repairable: No

Please check my previous response i had corrected the image for namespace and external references import 

Regards,
Nived N