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

Question

Question

Workflow Script Editor Reference Problem

asked on August 14, 2015 Show version history

When I reference a Class Library in the script editor it shows all my methods within the library and everything checks out in the script editor. But when I try to run the workflow it suddenly thinks the methods are missing. Has any other developers run into this?

 

0 0

Answer

SELECTED ANSWER
replied on August 18, 2015

Ok, figured out what it was. I had Workflow 32-bit installed so that I could work with the Microsoft 32-bit ODBC drivers for another project. When you install 32-bit it creates a workflow folder in both the program files folders but the problem occurred because I was referencing a DLL in the 64-bit program files Workflow folder. When I moved it to the 32-bit folder it resolved the issue. What is really strange is that I could use some of the features within the DLL.

Thanks for your help everyone. Knowing that it was working correctly in another environment gave me hope to keep trying. 

1 0

Replies

replied on August 14, 2015

When developing and testing workflow scripts, they compile and test locally off your pc's references. When publishing and running off the server, those referenced libraries need to be there too. Not 100% sure that's your issue as I'm sure you already knew that but just a friendly reminder to double check the workflow server and make sure the libraries are installed there.

0 0
replied on August 17, 2015

In this instance I am working directly from the server in my test environment. 

0 0
replied on August 17, 2015

Chad,

I duplicated your issue by creating a dummy DLL and referencing the DLL in an SDK script activity.  I can correctly reference the methods and properties and successfully run the SDK script from the script editor without error but when I run the activity in workflow I get the same error as you did. 

My assumption was that it is a permissions error actually loading the DLL so I moved the DLL to a different folder and specifically set the folder security permissions to full control for all users and the workflow runs without error.

 

replied on August 17, 2015 Show version history

Chad,

I tried to duplicate your issue thinking the problem might be related to permissions but I cannot duplicate the issue. 

When I create a dummy DLL and reference the DLL in an SDK Script activity I can access all of the public  methods and properties exposed by the DLL and the script runs successfully in both the editor and when I run the workflow. 

As a shot in the dark are the access modifiers of the assembly, methods, and properties marked as 'Public'?

FYI -  I am running Workflow 9.2.0.167

 

0 0
replied on August 17, 2015

I am running the same exact version. It is a public static void method. I was using a standard script object but I tried an SDK script (which I think is the same) and got the same problem.

 

 public static void Update()

 

0 0
replied on August 17, 2015 Show version history

Hmmm...  Here is my dummy class;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FI
{
    public class Pull
    {
        
        public string Update()
        {
            return "Hello World!";
        }

        
    }
}

 

Here is the script;

It executes without error in both the editor and as a workflow...

Would you be open to sharing your code to see if we can't duplicate the issue?

0 0
replied on August 17, 2015

This looks just like my environment. I wonder if it is because I am running the 32-bit version of Workflow. I am going to try on another enviornment.

0 0
replied on August 17, 2015

Where on the WF server did you place the DLL?  Did you properly register the DLL on the WF server?

0 0
replied on August 17, 2015

I have placed the DLL in the recommmended location and referenced it in the script activity

 

0 0
replied on August 17, 2015

Does the user that the Workflow Service runs as have permissions to the DLL file?

0 0
replied on August 17, 2015

Yes, I was actually using the DLL as a way to have a web reference. Many of the methods in the web reference are working until I eventually stumbled upon one of the methods saying it does not exist. Yet when I try in visual studio it has no problem. That is when I started testing creating my own methods and running into the same error. Workflow Service is running as local system.

0 0
replied on August 18, 2015

Where on the server machine is your reference?

Typically I see this issue when the referenced assembly is in multiple places and an older 'wrong' version is loaded by .NET. Usually the older assembly is in the GAC while the newer one is more local. 

Things to check:

Check C:\Windows\Microsoft.NET\assembly\GAC_32, then C:\Windows\Microsoft.NET\assembly\GAC_64, then C:\Windows\Microsoft.NET\assembly\GAC_MSIL and see if there is an older copy of your assembly. 

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

Sign in to reply to this post.