Unable to load assembly 'UiPath.Mail'. Cannot implicitly convert type 'object' to 'string'

Trying to run a workflow and getting the following compilation error:

21.10.3+Branch.master.Sha.8291b2799a85589c5b075e0d1f69016fc83eec97

Compilation failures occurred: 

	Unable to load assembly 'UiPath.Mail'.	Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)

Complete results are contained in the Data property of this exception.  Please correct the errors in the source and retry the Load.

RemoteException wrapping System.InvalidOperationException: Compilation failures occurred: 

	Unable to load assembly 'UiPath.Mail'.	Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)

Complete results are contained in the Data property of this exception.  Please correct the errors in the source and retry the Load. 
   at System.Activities.XamlIntegration.ActivityXamlServices.Compile(IDynamicActivity dynamicActivity, LocationReferenceEnvironment environment)
   at System.Activities.XamlIntegration.ActivityXamlServices.Load(XamlReader xamlReader, ActivityXamlServicesSettings settings)
   at System.Activities.XamlIntegration.ActivityXamlServices.Load(XmlReader xmlReader, ActivityXamlServicesSettings settings)
   at System.Activities.XamlIntegration.ActivityXamlServices.Load(Stream stream, ActivityXamlServicesSettings settings)
   at UiPath.Executor.WorkflowLoader.LoadWorkflow(String xamlPath, String compiledWorkflowAssemblyName)
   at UiPath.Executor.WorkflowRuntime.Load(String workflowFile)
   at UiPath.Executor.RobotRunner.InitWorkflowApplication()
   at UiPath.Executor.RobotRunner.<ExecuteJob>d__88.MoveNext()

I understand what “Cannot implicitly convert type ‘object’ to ‘string’” means, but I’ve gone through the workflow and there are no casting errors that I can see, nor does the editor give any warnings before compilation. The first part though, “Unable to load assembly ‘UiPath.Mail’”, I’ve no idea what it means, as I’m not using any mailing activities at all, nor does the workflow have any refrences to UiPath.Mail.

I had this happen to a different workflow as well (one which used to work btw, and got this error out of nowhere). I somehow managed to fix it by opening the file in a text editor, going through the xml and changing some instances of x:Object to x:String where I thought it made sense. Here though, I haven’t found any issues in the xml.

The error message doesn’t point out which activity is causing the error. I feel like this would’ve been helpful. As it is, I can’t figure out where in the workflow there could possibly be a casting error.

Here is the workflow file:
3. GetClientPEC.xaml (25.3 KB)

If anyone can find the error I’d be very grateful.

Hi There,

I looked at your workflow and can confirm ‘UiPath.Mail’ is not used however by default below dependencies are added.

“dependencies”: {
“UiPath.Excel.Activities”: “[2.11.4]”,
“UiPath.Mail.Activities”: “[1.12.2]”,
“UiPath.System.Activities”: “[21.10.2]”,
“UiPath.UIAutomation.Activities”: “[21.10.3]”
}

You can verify the same in your project.json file.

The quick solution is if you intended not to use Mail Activity… Remove the dependency and Done.

Try lowering the mail activity package.

Hope this helps.

Thank you for the response.
Actually UiPath.Mail.Activities is not included in my project dependencies:
image

Hi

Go to manage packages and upgrade the versions all the project dependencies and give a try

@mleao

In the end I just redid the whole workflow.
Needed a lot of revision anyway.
Thank you for your help though.

1 Like