Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Error on WebClient in Custom Workflow Activity on CRM Online

Posted on by Microsoft Employee

Hi Everyone,

I'm a bit stuck onthis one, working code in console application triggers following error with on demand workflow :

--------------

Error Message:

Unhandled exception:
Exception type: Microsoft.Xrm.Sdk.InvalidPluginExecutionException
Message: Inheritance security rules violated while overriding member: 'Microsoft.Reporting.WinForms.LocalReport.System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.

--------------

We narrowed the issue down to this snippet :

public static Stream GetStreamFromUrl(string url)
        {
            byte[] imageData = null;

            using (var wc = new System.Net.WebClient())
            {
                imageData = wc.DownloadData(url);
            }

            return new MemoryStream(imageData);
        }


Unfortunately I don't where to go from here, most posts I red indicate that it is because of the sandbox registration of the Custom Workflow Activity (It's for an online Dynamics).

references:

https://community.dynamics.com/crm/b/debajitcrm/archive/2016/03/28/knowhow-can-we-make-web-api-calls-from-plugins-in-dynamics-crm-2016

I am requesting against a static .rdlc file with no authentication (Azure public blob storage).

Thanks for your kind replies !

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans