Windows Workflow Foundation 3


WorkflowFoundation and Reflection


Hi!
 
In my scenario i need to load frameworks from assemblies that are actualy stored on my database.
 
At runtime, the assembly is dynamicly loaded using reflection and passed as parameter for instantiation to the workflow runtime:
 
//...
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters["Processo"] = process;
WorkflowInstance instance = _workflowRuntime.CreateWorkflow(getWorkflowType(process), parameters);
//...
 
private Type getWorkflowType(ProcessEntity process)
{
    LibraryFacade libraryService = new LibraryFacade();
    LibraryEntity library = new LibraryEntity();
 
    library = (LibraryEntity)libraryService.getByProcess(process);
 
    Assembly workflowAssembly = Assembly.Load(library.Binary);
    Type workflowType = workflowAssembly.GetType("ApplicationWorkflow");
 
    return workflowType;
}
The code above works perfectly! My problem is when i need to recover the process information:
 
//...
WorkflowInstance workflowInstance = manager.Workflow.GetWorkflow(_guid);
//...
 
That will throw an "FileNotFoundException"... Cannot find the file or assembly...
 
My first guess was that i would need to have the assembly loaded into the workflow application domain, but i was not very successfull with that...
 
Any help would be apreciated!
 
Best regards!
Answering my own question...
 
To solve the problem i should have subscribed to the AppDomain.AssemblyResolve to provide the missing assembly...

Related Links

SQLTrackingQuery from Workflow
CreateWorkflow failing validation
xbox live mic help
download code samples of Microsoft press' windows workflow foundation step by step - Kenn Scribner
Advantage and disadvantage of ASP.NET WorkFl
When do activities CANCEL and How do i force activities to cancel state?
Windows workflow 4.0 persistent issues
Windows Workflow 4
help needed in state machine workflow in asp.net
About the Role in WWF
Need suggestion of Workflow implementation
Invoking workflow from windows form
Tracking by objects
Sample unit testing project for a code activity
How to display the provider type summary in RuleSetDialog
Windows WF3.0 - get activity information from TrackingRecord object

Categories

MSDN
SharePoint
Windows Phone Dev Center
Apps for Office and Sh...
Architecture
JScript and Scripting
Machine Translation an...
Learning
Microsoft Robotics
ScriptJunkie
Development
Windows Hardware Devel...
Visio 2010
Archive
Archived Forums A-B
Archived Forums T-U
Archived Forums W
Internet of Things
Maps In Windows
Microsoft R
Visual C#
Visual Studio Editor
Visual Studio Unit Tes...
Windows App Studio Beta
Store Engagement Frame...
User Interface develop...
Windows Desktop Debugging
Windows Desktop Web Se...
Developing Apps for Of...
Excel for Developers
SharePoint 2010 - Gene...
Pricing & Billing
Azure Media Services
Azure Backup
Azure IoT Hub
Azure Analysis Services
Windows Workflow Found...
The Architect Role
BizTalk Server RFID
Commerce Server 2009
TPL Dataflow
Microsoft Robotics - S...
Microsoft Robotics - H...
Visual Studio Smart De...
SQL Server Tools
SQL Server Replication
SQL Server Spatial
SQL Server Application...
SQL Server Manageability
Standard 2009: Tools
Standard 7: Components...
Standard 7: Servicing ...
Windows Embedded Compa...
SQL Server 2012 PowerP...
SQL Server 2012 Integr...
SQL Server 2012 Analys...
Windows Forms General
SDK for Home Server 20...
Windows Live General: ...
Windows Live  Spaces: ...
MSDN Subscriptions Fee...
MSDN and TechNet Searc...
Bing Maps WPF, WP7/8/8...
Microsoft Lync Client ...
Silverlight 5
Silverlight 4
Silverlight Controls a...
Visual Studio & Silver...
Accessing Web Services...
Silverlight for Window...
Expression Design
Windows Performance To...
Microsoft Security Dev...
Retired SharePoint Col...
Announcements about pr...
ASMX Web Services and ...
Building Windows Store...
App Producer (archived)
Developer Documentatio...
General Troubleshootin...
Innovate on Office
ISV Community Days
Microsoft Security Dev...
MS-Build, Multi-Target...
Office Live Small Busi...
Oracle on Azure
Parallel Programming w...
Search Server: Develop...
SQL Server 2014 Databa...
Team Foundation Server...
Tools for Windows Stor...
Visual Studio Async CTP
Visual Studio Team Ser...
Visual Studio Source C...
Visual Studio UI Autom...
Windows CardSpace ('In...
Windows SideShow Devel...
Expression Blend for W...
Microsoft Graph

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile