Can't Compile the Project - Error CS0029

Hello world!

I am working on one robot that I made for a client that has been working properly on production for the past 6 months or so.

The other day the robot stopped working and I updated the robot packages to the latest version and after that every time I try to run it I get the following message:

“Compilaiton failed or was cancelled”. The assembly compilation returned the following errors: * (1,1547): error CS0029: Cannot implicitly convert type ‘System.Activities.InArgument’ to ‘System.Activities.InOutArgument’

I know that the solution is looking at all the places I use arguments to try and see which one is the one that is creating the problem but it used to work like it is. Also, why doesn’t it say the name of the argument that it’s creating the problem?

Thank you all.

Hi @ulises.ariza

Check the arguments types and there properties. As the package was updated to greater version might affect the argument type.

Thanks!

Hello @sarvesh.b

In the error log it appears that both of them are int32.

image

Hi @ulises.ariza

Common Scenarios That Trigger This

  1. Invoke Workflow File activity
  • You’re binding an In argument from the child workflow to an In/Out argument in the parent (or vice versa).
  • Example: Child workflow has counter (In/Out), but you pass a variable as In only.
  1. Custom activities or library projects
  • A property in a custom activity expects InOutArgument<T> but you’re giving just an InArgument<T>.
  1. Assign/Default Values in Arguments Panel
  • Trying to set a default value in an InOut argument (UiPath only allows for In).

:hammer_and_wrench: Solution

Check the activity/argument mapping:

  1. Open the Arguments panel in the workflow where the error occurs.
  2. Look at the argument directions:
  • If the called workflow/activity expects InOut, make sure you pass a variable (not a constant or expression).
  • If you don’t need InOut, change the direction to In.
  1. For Invoke Workflow File
  • If the child has InOut but you only need input, change it to In.
  • Or, in the parent, pass a variable (not just a literal or argument).
  1. Consistency
  • Argument direction in child workflow must match how it’s being used in the parent workflow.

I don’t know if this is intended but what I’ve done to fix the issue is delete the argument that was creating the issues, save the changes, create it again with the exact same parameters and save.

check all your arguments and make sure their types match exactly. For example, if your workflow expects an InOutArgument but you pass an InArgument, change the argument type or the passed value to InOutArgument. This stricter type check appeared after updating packages.

OR Recreate the arg.

If helpful, mark as solution. Happy automation with UiPath

@ulises.ariza

This is observed for multiple users..

Following these steps helped in fixing

If no xaml is found..check all int arguments recreate..when you recreate just make sure you dont break or change names

Cheers

Do you use source control? Perhaps you can track the changes?
Were you running the code directly in studio the last 6 months?

I fixed the issue a couple of hours ago. I re-created the argument and it worked.

What I did was I deleted the invoke to several parts of the process and tried to see if that compiled. Little by little I found which invoke was creating the problem. In the invoke I revised the arguments and re-created all of them like they were and it worked.

I find it kinda worrying that it couldn’t say which argument had the problem but I fixed anyway. Thank you all for your replies and I will save that information for the future.

I’d have expected you could have seen it from a visual scan to be honest. It could have been 10 minutes work, simply find all the references to an invoke workflow, and look for the one with the warning showing the arguments dont match, thats either by it displaying in orange or with an in line message.

I agree the compile error could be better, but for future reference on anyone reading this topic, there should be an easier method to fix it.

My issue here is that the only error I’ve gotten in the entire thing was this when I compile the project.
image

That’s why I had issues in fixing this because it didn’t say where was the issue or which argument had the issue. Also, technically they did not have an issue because I made the exact same argument I had before the problems.

Yes, I understand that, but I’m saying that usually, in an argument doesnt match in an invoke, you’ll get a warning in the invoke itself, either with it being orange or with the activity showing a warning.

You should have just been able to see it by checking for those visual cues, and finding every invoke is easy as you can do a search or use ‘find references’

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