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

Question

Question

"assuming assembly reference" in SDK Script Activity

asked on March 17, 2014

 

I have workflow containing an SDK Script activity that was originally built in 9.0. I needed to make a change today and when I opened up the script activity there was the following warning:

 

Assuming assembly reference 'Laserfiche.RepositoryAccess, Version=9.0.0.0, Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6' matches 'Laserfiche.RepositoryAccess, Version=9.1.0.0, Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6', you may need to supply runtime policy

I removed the 9.0 references and added the 9.1 references back in, but it didn't seem to help. I even created a new activity from scratch and still no go.

 

Since it's a warning, I decided to try and publish and run the workflow anyway. When the script ran I got the following:

 

[A]Laserfiche.RepositoryAccess.Session cannot be cast to [B]Laserfiche.RepositoryAccess.Session. Type A originates from 'Laserfiche.RepositoryAccess, Version=9.0.0.0, Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6' in the context 'Default' at location 'C:\Windows\assembly\GAC_MSIL\Laserfiche.RepositoryAccess\9.0.0.0__3f98b3eaee6c16a6\Laserfiche.RepositoryAccess.dll'. Type B originates from 'Laserfiche.RepositoryAccess, Version=9.1.0.0, Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6' in the context 'Defa

I understand what's going on here, but I can't seem to find any references to RA 9.0 in my workflow. Is there somewhere else I can look that might be hanging on to a reference?

0 0

Answer

SELECTED ANSWER
replied on March 19, 2014

The upcoming SDK 9.1 release will provide this file. If you can still 'publish anyway', then it should be fine since the WF server has the right version of LaserficheImaging.

 

Do you have SDK 9.0 installed on your machine and the WF server? If that's the case, you could downgrade everything back to 9.0 in the meantime.

 

Alternatively, you could use the designer on the WF server machine or install the WF server component on your designer machine (and not configure/use it).

 

 

 

1 0

Replies

replied on March 17, 2014 Show version history

What version of Document Processor or document services are you using? I had a similar problem and it was another reference that was actually causing the warning to be reported.

 

EDIT: if you can post a screenshot of the left references pane and the "using" list in the script, it would be helpful in pointing out which reference it might be.

0 0
replied on March 17, 2014

What is the latest version of DocumentServices that I should be using?

 

I just removed all of the references with the intention of building them back up one at a time. RA 9.1 is added by default. The compiler complained that it DocumentServices was needed because of my reference in the code, so I added DocumentServices 9.1. Now it's saying the following:

 

Referenced assembly 'Laserfiche.DocumentServices.dll' could not be resolved because it references the unresolved assembly 'LaserficheImaging.dll'

 

0 0
replied on March 17, 2014

Due to the way scripts are published it can be a bit of work to add references that have reference other non system .NET assemblies. Just work through the messages and it should work.

 

As for your original problem, I'll make a note in future workflow upgrades to automatically supply the 'system policy updates' it suggests.

0 0
replied on March 17, 2014

Maybe I'm missing something here. I didn't have to go through all of this when I originally built the workflow. RA was already there, and all I did was add a reference to DocumentServices.

 

There doesn't appear to be a version of LaserficheImaging that it's happy with.

0 0
replied on March 17, 2014

Could you post the code of your script that uses Document Services?

0 0
replied on March 17, 2014 Show version history
namespace WorkflowActivity.Scripting.SDKScript
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;
    using System.Text;
    using Laserfiche.RepositoryAccess;
    using Laserfiche.DocumentServices;
    using TiburonToPbk; //My custom assembly
    using TiburonToPbk.Models; //My custom assembly
    using System.IO;

    /// <summary>
    /// Provides one or more methods that can be run when the workflow scripting activity is performed.
    /// </summary>
    public class Script1 : RAScriptClass91
    {
        /// <summary>
        /// This method is run when the activity is performed.
        /// </summary>
        protected override void Execute()
        {
            ConnectionWrapperRA wrapper = this.ConnectToRA(ConnectionMethodRA.RepositoryAccess91);

            var srch = new Search((Session)wrapper.Connection);

            //Look for documents with a given case number
            srch.Command = @"{[JCSO Case Files]:[Case Number]=""%(ForEachRow_CaseNumber#<\d{2}>#)-%(ForEachRow_CaseNumber#<\d{2}(\d{5})>#)""}";
            srch.Run();

            SearchResultListing results = srch.GetResultListing(new SearchListingSettings());

            var de = new DocumentExporter();
            var rp = new ReferralPackage(); //An object from my custom assembly

            var docs = new List<DocumentInformation>();

            for(int i = 1; i <= results.RowsCount; i++)
            {
                //Convert the documents to PDF and store in a memory stream
                var ms = new MemoryStream();
                DocumentInfo docInfo = Document.GetDocumentInfo(results.GetEntryInfo(i).Id, (Session)wrapper.Connection);
                de.ExportPdf(docInfo, docInfo.AllPages, PdfExportOptions.IncludeText, ms);

                var doc = new DocumentInformation(); //An object from the custom assembly
                doc.EntryID = docInfo.Id;
                doc.FileName = docInfo.Name;
                //Convert to string for injection into the export package
                doc.FileContent = Convert.ToBase64String(ms.ToArray());

                docs.Add(doc);
            }

            rp.SendReferral((int)GetTokenValue("ForEachRow_ID"), docs);
        }
    }
}

Like I said, this was all working until I needed to republish the workflow that was created under 9 to the Workflow server that is now running 9.1.

0 0
replied on March 17, 2014

Thanks for the script, I'm going to see if I can figure out why the extra references are required. It might take me a little bit of time.

0 0
replied on March 17, 2014

Can you confirm the presence of these files on the WF server and designer machines?

 

C:\Windows\Microsoft.NET\assembly\GAC_32\LaserficheImaging\v4.0_9.1.0.0__3f98b3eaee6c16a6\LaserficheImaging.dll

 

C:\Windows\Microsoft.NET\assembly\GAC_64\LaserficheImaging\v4.0_9.1.0.0__3f98b3eaee6c16a6\LaserficheImaging.dll

0 0
replied on March 17, 2014 Show version history

Interesting. On the designer I have one that's version 8.4. The server has the expected 9.1 versions.

 

C:\Windows\Microsoft.NET\assembly\GAC_32\LaserficheImaging\v4.0_8.4.0.101__3f98b3eaee6c16a6

 

C:\Windows\Microsoft.NET\assembly\GAC_64\LaserficheImaging\v4.0_8.4.0.101__3f98b3eaee6c16a6

0 0
replied on March 17, 2014

OK, so double checking the Workflow installer, the Workflow server installs LaserficheImaging 9.1 but the Workflow Designer does not (because its not a dependency for the Designer).

 

You'll need to find an install that includes it. I believe the 9.1 client install does and the soon to be but not yet released 9.1 SDK.

 

 

 

 

0 0
replied on March 18, 2014

First thing this morning I reinstalled the 9.1.0.413 Client, but it doesn't seem to have installed a newer version of LaserficheImaging.

0 0
SELECTED ANSWER
replied on March 19, 2014

The upcoming SDK 9.1 release will provide this file. If you can still 'publish anyway', then it should be fine since the WF server has the right version of LaserficheImaging.

 

Do you have SDK 9.0 installed on your machine and the WF server? If that's the case, you could downgrade everything back to 9.0 in the meantime.

 

Alternatively, you could use the designer on the WF server machine or install the WF server component on your designer machine (and not configure/use it).

 

 

 

1 0
replied on March 19, 2014

I was playing around yesterday and, as you mention, the WF server has WF Designer. I can open the workflow and publish it just fine from there. It's just this one workflow, so I'm not terribly worried at the moment.

 

Thanks Ed!

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

Sign in to reply to this post.