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

Question

Question

Custom Workflow Activity SDK 9.1

asked on April 9, 2014

Hi,

I am having a problem building a custom activity with the latest SDK.

I started building it on 9.0. Have some issues so decided to update to latest version.

Now I get this error when runing the activity.

 

4/9/2014 9:55:00 AM||System.InvalidCastException: [A]Laserfiche.RepositoryAccess.Session cannot be cast to [B]Laserfiche.RepositoryAccess.Session. Type A originates from 'Laserfiche.RepositoryAccess, Version=8.2.0.0, Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6' in the context 'Default' at location 'C:\Windows\assembly\GAC_MSIL\Laserfiche.RepositoryAccess\8.2.0.0__3f98b3eaee6c16a6\Laserfiche.RepositoryAccess.dll'. Type B originates from 'Laserfiche.RepositoryAccess, Version=9.1.0.0, Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Laserfiche.RepositoryAccess\v4.0_9.1.0.0__3f98b3eaee6c16a6\Laserfiche.RepositoryAccess.dll'.
   at PDF_To_Tiff_Activity.PDFtoTIFF.Execute(ActivityExecutionContext executionContext) in C:\Users\gianfrancop\Documents\Visual Studio 2010\Projects\PDF_To_Tiff_Activity\PDF_To_Tiff_Activity\PDFtoTIFF.cs:line 62

Seems that in the reference there is some ReposirotyAccess version 8.2.

I try remove all laserfiche references and add them one by one. And still the same.

 

The problem is when the Session is created:

 

        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {

            try
            {
                using (ConnectionWrapper wrapper = executionContext.OpenConnectionRA())
                {

                    string sTempTIFF = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".tiff";
                    string sTempPDF = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".pdf";


                    Laserfiche.RepositoryAccess.Session session = (Laserfiche.RepositoryAccess.Session)wrapper.Connection;

 There is a very similar problem on https://answers.laserfiche.com/questions/52535/assuming-assembly-reference-in-SDK-Script-Activity

But I couldn't figure out a solution for me.

 

Any help will be appreciated.

Thanks!

 

 

Gian

 

0 0

Replies

replied on April 9, 2014

Gian - Not sure if it is the same problem I encountered when I moved from SDK 8x to 9.0 but I ended up just creating a new project with the new SDK template and copying the appropriate code from the old project into the new one.  Seemed simpler than trying to figure out what the problem was!  ;-)

0 0
replied on April 9, 2014 Show version history

You want to use OpenConnectionRA91 so your activity will use RepositoryAccess 9.1.

 

EDIT: you will need to install the latest hotfix for 9.1.1 for this to work: https://support.laserfiche.com/KB/1013462

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

Sign in to reply to this post.