Help: 'File': static types cannot be used as type arguments

Hi,

I’m getting the following issue in my workflow; I just added get outlook mail activity to my reframework flow, and in the process state, I put a condition to verify the subject line, and nothing else. But I don’t know why I’m getting this issue… I looked into everything, but I still am unable to resolve this issue.

UiPath version: Studio 2024.2.1-beta.15932 - 2/23/2024 Community License

Unexpected error has occurred during the library compilation process:
The assembly compilation returned the following errors:
 * (1,12666): error CS0718: 'File': static types cannot be used as type arguments
 * warning CS1701: Assuming assembly reference 'System.Linq.Expressions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'System.Activities' matches identity 'System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Linq.Expressions', you may need to supply runtime policy
 * warning CS1701: Assuming assembly reference 'System.Linq.Expressions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'System.Activities' matches identity 'System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Linq.Expressions', you may need to supply runtime policy
 * warning CS1701: Assuming assembly reference 'System.Linq.Expressions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'System.Activities' matches identity 'System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Linq.Expressions', you may need to supply runtime policy
 * warning CS1701: Assuming assembly reference 'System.Linq.Expressions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'System.Activities' matches identity 'System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Linq.Expressions', you may need to supply runtime policy

Regards,
Vinit Mhatre

Hi @Vinit_Mhatre

Please try updating all the packages to the highest version number and keep the run time rule as lowest applicable version and that might resolve the issue.

Regards

Hi @vrdabberu ,

I Also try to degrade the version of system activities with runtime rule lowest still getting same error.

image

Error:

Unexpected error has occurred during the library compilation process:
The assembly compilation returned the following errors:
 * (1,12666): error CS0718: 'File': static types cannot be used as type arguments
 * warning CS1701: Assuming assembly reference 'System.Linq.Expressions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'System.Activities' matches identity 'System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Linq.Expressions', you may need to supply runtime policy
 * warning CS1701: Assuming assembly reference 'System.Linq.Expressions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'System.Activities' matches identity 'System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Linq.Expressions', you may need to supply runtime policy
 * warning CS1701: Assuming assembly reference 'System.Linq.Expressions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'System.Activities' matches identity 'System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Linq.Expressions', you may need to supply runtime policy
 * warning CS1701: Assuming assembly reference 'System.Linq.Expressions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' used by 'System.Activities' matches identity 'System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of 'System.Linq.Expressions', you may need to supply runtime policy

Regards,
Vinit Mhatre

Hi @Vinit_Mhatre

Try deleting the system.linq.expressions from the imports panel and again import them and let me know what is the status. Before deleting them please xomment out the activities in which the linq expressions are being used.

Regards

Hi @vrdabberu ,

I didn’t use any linq expressions in my process, process is simple i have added two things only first in init stage i have added “Get Outlook Mail Messages” and in process stage there is one condition to check if the subject line is exist or not that’s it… Also try to remove the linq.expressions from the imports still i am getting same error

Regards,
Vinit Mhatre

Hi @Vinit_Mhatre . Can you the provide the screenshot of the condition to check the subject line?

Hi @devik ,

I think i am getting error at this condition, i tried to comment out the condition and error gone… Actually i have made modification into REFRAMEWORK template as per outlook…

Arguments as below:

Regards,
Vinit Mhatre

Why not use For each mail activity inside Use outlook mail and loop through the mails where subject is “your condition”. You can add the filters inside the For each mail activity. No need to use conditions in this. would you try this ?

I am using reframework in this process, thus there is no purpose for using foreach here.

yeah makes sense. Im not sure but in the condition “=” is an probably an assign operator. check whether the output is returning a boolean value.

Reads to me like you have a variable called ‘File’ somewhere or a LINQ expression using it incorrectly.

Are you aware you cannot use community for commerical purposes as this seems like it might be for commerical purposes?