K2 BLACKPEARL PRODUCT DOCUMENTATION: USER GUIDE
.NET Framework in K2 for Visual Studio

K2 for Visual Studio - .NET Framework in K2 for Visual Studio

K2 for Visual Studio is able to build Workflow processes targeting .NET Framework 3.5, .NET Framework 4.0 as well as .NET Framework 4.5. When utilizing this functionality in the new K2 for Visual Studio it is important to take note of how K2 blackpearl targets these .NET Frameworks. 

Note that as of K2 blackpearl 4.6.5, K2 for Visual Studio will use the .NET 4.0 Target Framework by default.

The table below illustrates which processes are able to function on which target framework to better decide which target framework to use when designing K2 workflow processes.  

.NET 3.5 Target Framework .NET 4.0 Target Framework .NET 4.5 Target Framework
Visual Studio Visual Studio Visual Studio
K2 Studio K2 Studio K2 Studio
K2 Designer for SharePoint

Important Considerations:

Selecting the .NET Target Framework:

To select the target framework for a new K2 for Visual Studio project perform the following steps:

Choose to create a new K2 for Visual Studio project

On the New Project configuration screen select the relevant .NET Framework as displayed below. 

Changing the Targeted .NET Framework of an existing K2 Project:

To select the target framework for a new K2 for Visual Studio 2012 project perform the following steps:

Open the existing K2 Project.

In Solution Explorer, right click on the Project Node and select Properties

The following screen will be displayed. In older versions of Microsoft Visual Studio the interface will differ.

Change the Target Framework Version to the required Targeted .NET Framework. Save the changes.

Ensure to select either 3.5 or 4.0.  Selecting any other version might cause the Project to not compile or Deploy

The following message will be displayed. Select Yes. The project will reload, Build the project and correct any errors in order to build successfully.

Configuring the K2 HostServer to run .NET Framework 4.0:

To ensure that workflow processes are able to deployed successfully when using the .NET Framework 4.0 in K2 for Visual Studio 2012 it is critical that the K2 Server be updated to run .NET Framework 4.0. The installer will update the K2 HostServer automatically from the 4.6.5 release.

Console Applications

An error may occur when starting a process instance via a console application created for .NET Framework 4 when referencing the SourceCode.Workflow.Client assembly where the assembly runtime version is v2.0.50727.

Error Example

Workaround

Edit the project app.config file and add the following entry [useLegacyV2RuntimeActivationPolicy=”true”]:

Now recompile and run the console application

 

 


K2 blackpearl Help 4.6.11 (4.12060.1731.0)