Author Topic: Assembly not found during ServerTask Call.  (Read 5337 times)

Offline grondeau

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Assembly not found during ServerTask Call.
« on: November 13, 2019, 10:37:30 AM »
Hi.

When exectuing the following call:

"Id returnParamsHome = (Id)SystemClient.ExecuteServerTask("Address Management", "CreateRecord", new Type[] { typeof(string[]), typeof(object[]) }, new object[] { AddressDetail[0], AddressDetail[1] });"

I get the following error:

"Error calling server task.
Impossible to fing assembly 'Pcm.Client.FormTasks.Company, Version=6.5.3.1, Culture=neutral, PublicKeyToken=47e8a196c40562a5'."

(The error message I get is in French, so it might not be an exact translation)

I tried looking to see if, maybe, the client dll didn't get into the ServerTask for some reason, but everything seems to be in order. Another thing I tried is getting the ServerTask MetaItem, and the methods I'm trying to call aren't listed in the WorkFlowCompatibleMethods list of the ServerTask object.

Any help would be appreciated.

Offline MartinR

  • Jr. Member
  • **
  • Posts: 5
  • Karma: +0/-0
    • View Profile
    • TA CRM Solutions Limited
Re: Assembly not found during ServerTask Call.
« Reply #1 on: November 14, 2019, 04:33:29 AM »
I assume the is error generated on the server (ie in the Pivotal event log)? 

Do you really have a server task in an assembly called Pcm.Client.something?  That's a really bad idea - server and client code should not be mixed in a single assembly or you will have to add all sorts of extra assemblies to both sides.

If you MUST have the server code in a client task, then when you import the client task you need to tick the Server box as well as the client box or it will not be downloaded to the server tasks folder.  But really, just don't have server code in a client task, put it in a server task!

Martin

Offline grondeau

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Assembly not found during ServerTask Call.
« Reply #2 on: November 14, 2019, 05:08:49 AM »
Hi. No, the two dll are separated. It is part of the reason I am so confused! While calling the server Task, it is the name of the client task that is shown in the error message.

The calling client Task is the one shown before: "Pcm.Client.FormTasks.Company"
The called server Task should be in an assembly called "Pcm.Server.FormTasks.Company".

Sorry for the misunderstanding.

And the error is shown when passing on the line "SystemClient.ExecuteServerTask". It did not reach my breakpoint in the beginning on the server Task.
« Last Edit: November 14, 2019, 05:10:21 AM by grondeau »