Question

In an IIS hosted workflow service, how do I get the current path of the workflow?

For example, my workflow is deployed in the following directory:

/Site/WebApp/SubDir/MyWorkflowService.xamlx

If the IIS application is created on /Site/WebApp (and the web.config is in this directory), how do I get the path /Site/WebApp/SubDir from inside a CodeActivity or NativeActivity?

I figured out how to get the path of the IIS application by using System.Web.Hosting.HostingEnvironment, but I am unable to find a way to find the path of the current workflow if it is deployed in a sub-directory of an IIS applcation.

Was it helpful?

Solution

The easiest option is to do determine the path at startup time in an IServiceBehavior.ApplyDispatchBehavior() and use a workflow extension to provide it to your workflow activities.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top