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

Question

Question

Workflow SDK example

asked on October 18, 2019 Show version history

I have the workflow SDK installed and am opening the template provided. I followed the instructions in the Building Custom Activities in Workflow 83 (C#) file to the letter but that really doesn't matter since when I try to compile, I get an error on one of the very first lines:

using Laserfiche.Custom.Activities;

showing this error:

Error	CS0234	The type or namespace name 'Custom' does not exist in the namespace 'Laserfiche' (are you missing an assembly reference?)

I confirmed there is a reference to:

C:\Program Files (x86)\Common Files\Laserfiche\Workflow\Laserfiche.Workflow.Activities.Custom.dll

which when you View in Object Browser shows:

namespace Laserfiche.Custom.Activities
    Member of Laserfiche.Workflow.Activities.Custom

I also tried this just for fun and it did not work:

using Laserfiche.Workflow.Activities.Custom;

giving this error:

Error	CS0234	The type or namespace name 'Workflow' does not exist in the namespace 'Laserfiche' (are you missing an assembly reference?)

My thoughts are that since I am running Workflow 10.4 and Visual Studio 2019 that the code provided might be outdated, but if that was the case I would hope that Laserfiche would have some sort of update to the template (and sample code).

 

If someone could point me in the right direction, or preferably provide a simple working template or sample Workflow Activity written in C# I would be very grateful.

2 0

Answer

SELECTED ANSWER
replied on October 21, 2019

UPDATE: I created that project from the Laserfiche Workflow Custom Activity template provided. The template has the target framework as .NET Framework 4, and changing it to 4.5 or higher solves this specific issue.

1 0
replied on October 22, 2019

Hi Paul, thanks for reporting. The actual Workflow SDK currently targets .NET Framework 4.5 - looks like the sample templates weren't updated from .NET Framework 4 though.

We've added a task to update the templates to match the actual Workflow SDK .NET Framework version for future releases.

0 0
replied on November 19, 2019 Show version history

Sorry, I don't believe I had any other issues following the "Building Custom Activities in Workflow 83 (C#).pdf" guide.

I did have one issue using files if they were saved on my network drive, but once I saved them locally everything worked.

In case it helps, my project is set to Any CPU, and has references to both:
C:\Program Files (x86)\Common Files\Laserfiche\Workflow\Interop.LFSO83Lib.dll
C:\Program Files (x86)\Common Files\Laserfiche\Workflow\Interop.LFSO90Lib.dll

 

Replies

replied on November 19, 2019 Show version history

Hi Paul @████████ , I am also attempting to build a custom activity in Visual Studio 2019 using the provided Visual Studio 2010 templates.

I have changed the assembly framework to 4.5, and it is building fine, but I am getting stuck importing the custom activity using the workflow configuration manager - I keep getting the message "An attempt was made to load a program with an incorrect format."

 

I have tried building in x86, x64 and Any CPU, and I tried removing the references to Interop.LFSO90Lib.dll and Interop.LFSO83Lib.dll, but still not working.

Have you had any luck with linking your custom activity? If so, please let me know how you managed it.

0 0
replied on November 19, 2019

Sorry, I don't believe I had any other issues following the "Building Custom Activities in Workflow 83 (C#).pdf" guide.

I did have one issue using files if they were saved on my network drive, but once I saved them locally everything worked.

In case it helps, my project is set to Any CPU, and has references to both:
C:\Program Files (x86)\Common Files\Laserfiche\Workflow\Interop.LFSO83Lib.dll
C:\Program Files (x86)\Common Files\Laserfiche\Workflow\Interop.LFSO90Lib.dll

0 0
replied on May 19, 2021 Show version history

Hi there, I had the same kind of issue and found it was due to my library references.

I added Interop.LFSO104Lib manually as only nterop.LFSO90Lib was referenced by the template.

Then from your class script(.cs) add using LFSO104Lib; and remove any other using LFSOxxxLib

frown  Hope it helps

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

Sign in to reply to this post.