You are viewing limited content. For full access, please sign in.

Question

Question

Workflow Script Action error : .NET Framework does not enable CAS policy by default

asked on May 22, 2016

Hi All ,

I am running a action script inside the workflow to write some values in a csv file. 

When I execute the workflow it gives a warning message stated below and the script action is not executing 

I found this warning message under Workflow designer "today's activity --> message" 

warning message : "An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information."

 

I have also attached a screenshot <error.png> .

I have also updated my .net framework to 4.5.2 version but no luck. 

 

Please help me to solve this issue .. So i cancontinue building and testing my workflow.

thanks in advance ... 

 

error.png
error.png (18 KB)
0 0

Replies

replied on May 23, 2016

What assemblies are you referencing in your script and where are you loading them from?

0 0
replied on May 23, 2016

Hi Miruna

Thanks for replying  .. I didnt write any code inside the script. I just added that script action in the workflow, It gives me the above mentioned error. 

the below given code is there inside the script action ( it is auto generated wen i add the action into the workflow) 

 

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text

Namespace WorkflowActivity.Scripting.Script
    '''<summary>
    '''Provides one or more methods that can be run when the workflow scripting activity is performed.
    '''</summary>
    Public Class Script1
        Inherits ScriptClass90
        '''<summary>
        '''This method is run when the activity is performed.
        '''</summary>
        Protected Overrides Sub Execute()
            'Write your code here.
        End Sub
    End Class
End Namespace

0 0
replied on May 24, 2016 Show version history

I'm confused, your original post says you're running a script to write to a CSV file...

What version of Workflow is this?

0 0
replied on May 24, 2016

Hi Miruna,

Sorry for confusing you, First post i tried with a script for writing csv.

second time i tried by just adding that action script.

Both resulted the same error. 

 

My workflow designer version is 10.0.0.249

 

0 0
replied on May 24, 2016

Please try adding the loadFromRemoteSources element to machine.config file per here.

0 0
replied on May 25, 2016

Hi Xiaoxiao,

I checked the machine.config file. It is already there. Please check the attachment <sample.png> 

sample.png
sample.png (57.81 KB)
0 0
replied on May 26, 2016

Your problem is caused by the other element in that runtime section. NetFX40_LegacySecurityPolicy set to true is superseding loadFromRemoteSources. The security policy for .Net 4 is off by default. Can you turn it off or explain why it was turned on? There is no way to specify exceptions for it, so Workflow will not run with it on.

0 0
replied on May 26, 2016

Hi Miruna,

I have set that NetFX40_LegacySecurityPolicy to false but even then the same error comes.

error.png
error.png (100.15 KB)
0 0
replied on May 27, 2016

Can you double-check that you don't have multiple machine.config files and then restart the WF server?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.