Error CS0029: Cannot implicitly convert type 'System.Activities.InArgument<int>' to 'System.Activities.OutArgument<int>'

Hi

Any tips for troubleshooting the problem shown below?

Validate File/Project shows no errors.
The error occurs when trying to debug/run the project.

It seems to relate to an argument of type Int32.
I only have one argument of that type and I cant see what the problem is.

Error:
image

Arguments:

Regards
Soren

1 Like

hi, @SorenB Check your Int32 argument direction—it should match in both workflows.

If it’s “Out” in one place, make sure it’s “Out” everywhere you use it.
Mismatch (like In vs Out) causes compilation errors.

Hello @SorenB,

Follow these steps:-

  1. If it’s meant to return a value → keep it Out and link it to a variable in the parent workflow.
  2. If it’s meant to both send and receive → make it In/Out.
  3. If it’s only an input → change it to In.

The workflow is not used anywhere else - it is a rather newly added file.
Find References shows nothing.

It is meant to return info and the direction is already set to Out.

@SorenB Try Checking the argument inside your new workflow - direction and type.
Delete and re-add it if needed.
Even unused or mismatched arguments can break compilation on new files.

The Out argument is fine — just make sure the calling workflow connects it to a variable, not a literal or an InArgument.

Something happened with at least one argument of type System.Int32.

Try to find all of them, delete them one by one and recreate them with the correct Direction in case you still need them.

@SorenB

In migrations and newer studio multiple poeple experienced the same

And deleted the argument completely recreating and relinking it fixed

Cheers

Thanks @Anil_G

It sure was a bug, and removing/re-adding the argument did the trick :+1:

1 Like

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