WF projects that use new .NET 4.5 features fail to build when re-targeted to .NET Framework 4

Windows Workflow Foundation (WF) in .NET Framework 4.5 introduces many new features, such as new activities, designer capabilities, and workflow development models. These features are described in What's New in Windows Workflow Foundation in .NET 4.5. These new WF features are not available for projects that target previous versions of the framework. If a project that targets .NET Framework 4.5 is re-targeted to a previous version of the framework, several issues will occur.

  • C# expressions will be replaced in the designer with the message Value was set in XAML.
  • Build errors similar to the following will occur.

Error 1 The file format is not compatible with current targeting framework. To convert the file format, please explicitly save the file. This error message will go away after you save the file and reopen the designer.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 0 0 
Error 2 Could not resolve attachable member 'http://schemas.microsoft.com/netfx/2009/xaml/activities:TextExpression.NamespacesForImplementation'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 11 4 WorkflowConsoleApplication20
Error 3 Could not resolve attachable member 'http://schemas.microsoft.com/netfx/2009/xaml/activities:TextExpression.ReferencesForImplementation'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 20 4 WorkflowConsoleApplication20
Error 4 Could not resolve type 'System.Collections.ObjectModel.Collection(AssemblyReference)' because could not find one or more of its type arguments.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 21 6 WorkflowConsoleApplication20
Error 5 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 21 6 WorkflowConsoleApplication20
Error 6 Type 'System.Collections.ObjectModel.Collection(AssemblyReference)' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 22 8 WorkflowConsoleApplication20
Error 7 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 22 8 WorkflowConsoleApplication20
Error 8 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 22 44 WorkflowConsoleApplication20
Error 9 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 23 8 WorkflowConsoleApplication20
Error 10 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 23 34 WorkflowConsoleApplication20
Error 11 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 24 8 WorkflowConsoleApplication20
Error 12 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 24 45 WorkflowConsoleApplication20
Error 13 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 25 8 WorkflowConsoleApplication20
Error 14 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 25 39 WorkflowConsoleApplication20
Error 15 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 26 8 WorkflowConsoleApplication20
Error 16 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 26 39 WorkflowConsoleApplication20
Error 17 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 27 8 WorkflowConsoleApplication20
Error 18 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 27 56 WorkflowConsoleApplication20
Error 19 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 28 8 WorkflowConsoleApplication20
Error 20 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 28 47 WorkflowConsoleApplication20
Error 21 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 29 8 WorkflowConsoleApplication20
Error 22 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 29 58 WorkflowConsoleApplication20
Error 23 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 30 8 WorkflowConsoleApplication20
Error 24 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 30 39 WorkflowConsoleApplication20
Error 25 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 31 8 WorkflowConsoleApplication20
Error 26 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 31 38 WorkflowConsoleApplication20
Error 27 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 32 8 WorkflowConsoleApplication20
Error 28 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 32 43 WorkflowConsoleApplication20
Error 29 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 33 8 WorkflowConsoleApplication20
Error 30 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 33 36 WorkflowConsoleApplication20
Error 31 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 34 8 WorkflowConsoleApplication20
Error 32 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 34 56 WorkflowConsoleApplication20
Error 33 Could not find type 'Microsoft.CSharp.Activities.CSharpReference(Int32)' in assembly 'System.Activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 44 12 WorkflowConsoleApplication20
Error 34 Type 'Microsoft.CSharp.Activities.CSharpReference(Int32)' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 44 61 WorkflowConsoleApplication20
Error 35 Could not find type 'Microsoft.CSharp.Activities.CSharpValue(Int32)' in assembly 'System.Activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 49 12 WorkflowConsoleApplication20
Error 36 Type 'Microsoft.CSharp.Activities.CSharpValue(Int32)' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 49 88 WorkflowConsoleApplication20
Error 37 Could not find type 'Microsoft.CSharp.Activities.CSharpValue(String)' in assembly 'System.Activities'.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 55 10 WorkflowConsoleApplication20
Error 38 Type 'Microsoft.CSharp.Activities.CSharpValue(String)' does not have a suitable TypeConverter or content property to handle this content.
 C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 55 75 WorkflowConsoleApplication20

  • If the re-targeted project is opened in Visual Studio 2010, build errors similar to the following occur.

Error 1 Could not resolve attachable member 'http://schemas.microsoft.com/netfx/2009/xaml/activities:TextExpression.NamespacesForImplementation'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 11 4 WorkflowConsoleApplication20
Error 2 Could not resolve attachable member 'http://schemas.microsoft.com/netfx/2009/xaml/activities:TextExpression.ReferencesForImplementation'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 20 4 WorkflowConsoleApplication20
Error 3 Could not resolve type 'System.Collections.ObjectModel.Collection(AssemblyReference)' because could not find one or more of its type arguments. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 21 6 WorkflowConsoleApplication20
Error 4 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 21 6 WorkflowConsoleApplication20
Error 5 Type 'System.Collections.ObjectModel.Collection(AssemblyReference)' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 22 8 WorkflowConsoleApplication20
Error 6 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 22 8 WorkflowConsoleApplication20
Error 7 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 22 44 WorkflowConsoleApplication20
Error 8 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 23 8 WorkflowConsoleApplication20
Error 9 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 23 34 WorkflowConsoleApplication20
Error 10 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 24 8 WorkflowConsoleApplication20
Error 11 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 24 45 WorkflowConsoleApplication20
Error 12 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 25 8 WorkflowConsoleApplication20
Error 13 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 25 39 WorkflowConsoleApplication20
Error 14 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 26 8 WorkflowConsoleApplication20
Error 15 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 26 39 WorkflowConsoleApplication20
Error 16 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 27 8 WorkflowConsoleApplication20
Error 17 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 27 56 WorkflowConsoleApplication20
Error 18 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 28 8 WorkflowConsoleApplication20
Error 19 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 28 47 WorkflowConsoleApplication20
Error 20 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 29 8 WorkflowConsoleApplication20
Error 21 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 29 58 WorkflowConsoleApplication20
Error 22 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 30 8 WorkflowConsoleApplication20
Error 23 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 30 39 WorkflowConsoleApplication20
Error 24 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 31 8 WorkflowConsoleApplication20
Error 25 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 31 38 WorkflowConsoleApplication20
Error 26 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 32 8 WorkflowConsoleApplication20
Error 27 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 32 43 WorkflowConsoleApplication20
Error 28 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 33 8 WorkflowConsoleApplication20
Error 29 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 33 36 WorkflowConsoleApplication20
Error 30 Could not find type 'AssemblyReference' in namespace 'http://schemas.microsoft.com/netfx/2009/xaml/activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 34 8 WorkflowConsoleApplication20
Error 31 Type 'http://schemas.microsoft.com/netfx/2009/xaml/activities:AssemblyReference' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 34 56 WorkflowConsoleApplication20
Error 32 Could not find type 'Microsoft.CSharp.Activities.CSharpReference(Int32)' in assembly 'System.Activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 44 12 WorkflowConsoleApplication20
Error 33 Type 'Microsoft.CSharp.Activities.CSharpReference(Int32)' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 44 61 WorkflowConsoleApplication20
Error 34 Could not find type 'Microsoft.CSharp.Activities.CSharpValue(Int32)' in assembly 'System.Activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 49 12 WorkflowConsoleApplication20
Error 35 Type 'Microsoft.CSharp.Activities.CSharpValue(Int32)' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 49 88 WorkflowConsoleApplication20
Error 36 Could not find type 'Microsoft.CSharp.Activities.CSharpValue(String)' in assembly 'System.Activities'. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 55 10 WorkflowConsoleApplication20
Error 37 Type 'Microsoft.CSharp.Activities.CSharpValue(String)' does not have a suitable TypeConverter or content property to handle this content. C:\WFProjects\WorkflowConsoleApplication20\WorkflowConsoleApplication20\Workflow1.xaml 55 75 WorkflowConsoleApplication20

To resolve these issues, open the project in Visual Studio 2012, convert each C# expression to its Visual Basic equivalent, and then explicitly re-save each xaml file in the project. To explicitly save a XAML workflow file, double-click the workflow.xaml file in Solution Explorer to open it, press Ctrl+S to save, and then close and re-open the workflow in the workflow designer. When this is done for all XAML workflow files in the project, the project should successfully build, and can be opened in Visual Studio 2010 if desired.