Quantcast
Channel: Workflow Manager 1.0 forum
Viewing all articles
Browse latest Browse all 897

PublishWorkflow error when workflow contains custom code activity

$
0
0

I've failed to get a custom code activity working within Workflow Manager 1.0 even though I believe I've performed all of the guidance steps provided.

As other posts, I get the usual 'cannot create unknown type' error:

client.PublishWorkflow( workflowName, @"..\..\TestWorkflow.xaml" );

->

Cannot create unknown type '{wf://workflow.windows.net/$Current/$Activities}SendMailActivity'.

The activity is implemented as:

namespace SharedActivities { public sealed class SendMailActivity : CodeActivity {

...

I've created an AllowedTypes.xml file containing the following:

<?xml version="1.0" encoding="utf-8" ?><AllowedTypes><Assembly Name="SharedActivities"><Namespace Name="SharedActivities"><Type>SendMailActivity</Type></Namespace></Assembly></AllowedTypes>

The SharedActivities assembly has the following Post Build event command line

net stop "Workflow Manager Backend" %systemroot%\system32\inetsrv\appcmd stop apppool /apppool.name:"WorkflowMgmtPool" xcopy /y "$(TargetPath)" "C:\Program Files\Workflow Manager\1.0\Workflow\WFWebRoot\bin" xcopy /y "$(TargetPath)" "C:\Program Files\Workflow Manager\1.0\Workflow\Artifacts" copy /y $(ProjectDir)AllowedTypes.xml "C:\Program Files\Workflow Manager\1.0\Workflow\WFWebRoot\bin" copy /y $(ProjectDir)AllowedTypes.xml "C:\Program Files\Workflow Manager\1.0\Workflow\Artifacts" %systemroot%\system32\inetsrv\appcmd start apppool /apppool.name:"WorkflowMgmtPool" net start "Workflow Manager Backend"

Execution output :

1>------ Rebuild All started: Project: SharedActivities, Configuration: Debug Any CPU ------
1>  SharedActivities -> D:\Dev\Prototypes\WorkflowTest\SharedActivities\bin\Debug\SharedActivities.dll
1>  The Workflow Manager Backend service is stopping.......
1>  The Workflow Manager Backend service was stopped successfully.
1>  
1>  "WorkflowMgmtPool" successfully stopped
1>  D:\Dev\Prototypes\WorkflowTest\SharedActivities\bin\Debug\SharedActivities.dll
1>  1 File(s) copied
1>  D:\Dev\Prototypes\WorkflowTest\SharedActivities\bin\Debug\SharedActivities.dll
1>  1 File(s) copied
1>          1 file(s) copied.
1>          1 file(s) copied.
1>  "WorkflowMgmtPool" successfully started.
1>  The Workflow Manager Backend service is starting.
1>  The Workflow Manager Backend service was started successfully.
1>  
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

The assembly containing the custom activity is loaded into the Workflow host process.

I've configured my machine (development) to allow unsafe types.

Process Explorer/Powershell output

I've also uploaded my project so you can verify the implementation.

Thanks in advance, Adam


Viewing all articles
Browse latest Browse all 897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>