Invoke Code bug in newer versions

Hi guys,

When I update my System.Activities package version to a later version the Invoke Code breaks. Why is that?

When running on version 23.10.2 it works fine without any error…

I was also trying to update the package version because I notice a huge delay with this… sometimes it takes up to 2 minutes to send SMTP mail… also I cannot use the stock SMTP mail activities as this does not allow for embedding images into the email body which I was able to solve with code here.

@Jon_G,

Try importing namespace System.Net in your workflow where your Invoke code activity is.

The issue with Invoke Code breaking after updating **System.Activities is likely due to changes in dependencies, compatibility issues, or stricter type checking in the newer versions.

  1. Check Namespace Imports
    In newer versions, some namespaces might need to be explicitly imported in the Invoke Code activity.
    Ensure required namespaces like System.Net.Mail (for SMTP) and others are properly imported.
  2. Debug SMTP Delay Separately
    Since the SMTP delay issue might not be related to System.Activities, try:
    Using different SMTP servers (e.g., Office365, Gmail, custom SMTP).
    Checking firewall & network latency affecting SMTP response.
    Implementing asynchronous email sending in your code.

I have imported System.Net.Mail but no luck still

@Jon_G,

Ok. try replacing your Net.Mail... code with System.Net.Mail....

1 Like

Ah yes, using the full System.Net.Mail throughout my code fixes it!

Thanks so much

1 Like

@Jon_G,

I had also missed that in first instance and today I realized that could be the issue :smiley:

Cheer!

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