Start a K2 Process using CLR with SQL trigger

  • 21 April 2011
  • 2 replies
  • 8 views

Badge +1

I am trying to start a simple email process using an SQL trigger.


Firstly i created the parts seprately:



  • Set up a CLR job to Select the Inserted records
  • Created a Console application which starts a K2 process

When bringing the two together, i get the following error when trying to Create the Assembly on database server.


Create Assembly Code:


CREATE ASSEMBLY Incident
FROM 'E:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBinnTestClassLibrary1.dll'
WITH PERMISSION_SET = UNSAFE


Error:


Msg 6544, Level 16, State 1, Line 1
CREATE ASSEMBLY for assembly 'ClassLibrary1' failed because assembly 'sourcecode.hostclientapi' is malformed or not a pure .NET assembly.
Unverifiable PE Header/native stub.


Any input would be greatly received


Regards


Matt Warman


2 replies

Badge +9

Never tried it before but would this thread be related?


http://social.msdn.microsoft.com/Forums/en/sqlnetfx/thread/4a032c4b-1402-4c53-b34e-8c8bd724f904

Badge +1

i believe this could be the solution, my trouble comes with the p/invoke of "SourceCode.HostClientAPI.dll" and "SourceCode.Workflow.Client.dll" and the definition of the functions with in these.

Reply