.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Bug With Namespace in xaml that points to assembly with Workflows/Activities?

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :WPF
Hey All, Kind of an oddly worded question, but I'll try my best.   I have a xaml file with a namespace using at the top like this: xmlns:vm="clr-namespace:My.Namespace" This namespace is within an assembly that contains some Windows Workflow 4 designers and activities. [Designer(typeof(DeploymentDelegateDesigner))] public class ExecutionDelegate : NativeActivity { [DefaultValue(typeof(BuildDeployment))] public Activity Body { get; set; } /// <summary> /// /// </summary> /// <param name="context"></param> protected override void Execute(NativeActivityContext context) { context.ScheduleActivity(Body); } } In the above snippet, BuildDeployment is an activity.   If I build this project, an error occurs on the property attribute (DefaultValueAttribute) which states: "Error 43 The type or namespace name 'BuildDeployment' could not be found (are you missing a using directive or an assembly reference?) C:\dev\PathToProject\Activities\ExecutionDelegate.cs 13 30 My.Namespace" I've masked the error to hide some proprietary information.   This ONLY occurs when I have a custom namespace at the top of one of my xaml files. I've tried cleaning/rebuilding the solution, and restarting Visual Studio 2010. I'm at a loss on this one and it is a show stopper. &nbs

View Complete Post

More Related Resource Links

Foundations: Unit Testing Workflows And Activities


Matt Milner takes a look at some of the challenges and techniques related to testing Windows Workflow Foundation activities, workflows, and associated components.

Matt Milner

MSDN Magazine November 2008

Windows Workflow: Build Custom Activities To Extend The Reach Of Your Workflows


This article covers the core components required for building custom activities in Windows Workflow Foundation.

Matt Milner

MSDN Magazine December 2006

VS2010 XAML namespace intellisense not working

When I type in a namespace in XAML, I'm not getting any intellisense. For example: xmlns:local="" In VS2008 I would get a long intellisense list here. In VS2010 I get nothing. I have tried this on 2 different computers. What am I missing?

Cannot create unknown type '{clr-namespace:Blog.LongRunningWorkflow.Example.Activities}WaitForReques

Hi, I am facing problem in loading XAML at runtime. Below is the code please help me. public void ProcessRequest(Request request) { // Get the workflow instance id to use Guid instanceId = this.requestToInstanceMapping[request.Id];         // Setup the arguments that are passed to the workflow          IDictionary<string, object> input = new Dictionary<string, object>();              input.Add("Request", request);            using (FileStream fs = new FileStream(@"ProcessRequest.xaml", FileMode.Open))          {             // Load the ProcessRequest workflow           Activity wf = ActivityXamlServices.Load(fs) as Activity;                            // Create the workflow instance specifying the arguments and instance id                      WorkflowApplication wapp = new WorkflowApplication(wf, input);          string persistenceConnectionString = "Data Source=Dev1;Initial Catalog=InstanceStore;User id=sa;password=xxxxxxx;Asynchronous Processing=True";          &nbs

SPD Workflows - Assembly redirection doesn't work

Hi, I'm migrating a solution from MOSS2007 to SharePoint 2010. I have, among others, custom workflow actions in a DLL deployed to the GAC (e.g. MyWorkflows.dll version My new solution contains new workflow actions that target the SharePoint 2010 API (e.g. MyWorkflows.dll version So what I'm doing is: - Creating a workflow in SPD in a MOSS2007 environment. Such workflow contains one of my custom actions. - Upgrading the environment to SharePoint 2010. - Removing the WSP package containing my files/DLLs that targeted MOSS2007 and deploying a new WSP containing the solution files that target SharePoint 2010. - Add assembly redirection entries in the web.config file of my web application, so that calls to MyWorkflows.dll get redirected to MyWorkflows.dll version (I also add other redirection entries regarding other stuff - for example, webparts). - Reset IIS and OWSTIMER.   After that I can see that the old webparts work fine (the assembly redirection seems to work for them). However, when I try to run a workflow (manually, from the browser) it doesn't work. I get the following error in the ULS log: Microsoft.SharePoint.SPException: <Error><CompilerError Line="15" Column="3" Text="Could not deserialize object. The type 'MyWorkflows.MyActivity' could not be resolved." /></Error>   &nbs

Namespace resolution issue when loading activities designed in VS2010 in rehosted WorkflowDesigner

Hi. I have activities that is made in VS2010, that are to be used in a rehosted WorkflowDesigner app. In the rehosted app I have a WorkflowDesigner, a toolbox with all the standard and my custom activities, and a property window. The problem occures when I load a composite activity that has reference to other custom activities (and that is drawn in the designer in VS2010). In the rehosted app the composite activity is shown almost as expected, except that all the referenced activities are shown in the designer as a red error message: "Activity could not be loaded because of errors in the XAML."  If I load the same activity in VS2010 it works.  If I remove the referenced activity in the rehosted app and adds it from the toolbox there, it works. If I draw the composite activity in the rehosted app from "the ground up", it works. If I compare the activity XAML that is saved in VS2010, and the activity XAML when opened, modified and saved in the rehosted app, I find differences in how namespaces are expressed: The Activity-XAML from VS2010 has namespace resolution at the top: xmlns:local="clr-namespace:WCFWorkflowPOC" The Activity-XAML from the rehosted app does not save namespace resolution at the top. If I add the activity in the rehosted app insted of in VS2010, it places namespace resolution

Declarative XAML Workflows in WF 3.5

Upon reading the article at: http://channel9.msdn.com/shows/Endpoint/endpointtv-Screencast-Declarative-XAML-Workflows-in-WF-35/ and reproduce what the author has in the video the following error occurs: "The hosting environment of the workflow has no persistence service as is necessary in an operation in the instance of the workflow" 1007b86a-E638-4240-8579-25b976d81730 " when I try to execute the same code for this video, the error occurs on line instance.EnqueueItemOnIdle("readLineActivity1", input, null, null); how to solve?

"Assembly '...' Was Not Found" When including a reference to a local namespace

I've got a WPF application with a window and a usercontrol:   Window:   <Window x:Class="UI.Windows.Main" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:UI.Windows.Documents" Title="Window1" Height="600" Width="800"> <DockPanel> <!-- Snip --> </DockPanel> </Window>     UserControl:   <UserControl x:Class="UI.Windows.Documents.MyDisplay" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml> <Grid> <!-- Snip --> </Grid> </UserControl>       Now, when I try to look at this in the designer i get an error saying Assembly 'UI' was not found.  I've searched high and low, but the internet is full of references to this being a 2005 issue and the solution is to upgrade to 2008.  I'm already using 2008 (don't even have 2005 installed on the machine), and I still get the problem.

Handling Type namespace/assembly change during serialization

We needed to move a class from one assembly to another due to referencing issues.  However, we have Workflows in the field where this type is serialized into them and we get the Failed to load type error.  I was wondering if there was anything like AssemblyResolve for handling type load failures where we can correct the type and load the correct one?

Assembly only used in xaml not copied to application folder


Hi, I have used a couple of assemblies (in a control library) where they have stuff (eg properties) only ever referenced in xaml. In these cases, the assemblies, are not being copied to the applications main folder.

As soon as I reference something in them from normal C# code, they get copied!

THis is in dev studio 2010, has anyone else had this, and know how to get around it?

Thanks in advance



VS2008 WPF Xaml: Is there a path length limit when loading an assembly?



It seems that there is a path lenght limit for VS2008 when loading XAML assemblies.

Using the Microsoft sample Southridge, if the project is stored on "C:\Projects\C# samples\Southridge_Labs\1.Southridge_Fundamentals\Start" the designer does not load the assemblies.

But if I copy my files the project to the root (C:\Southridge_Labs\1.Southridge_Fundamentals\Start) then it works fine.

Basically I have solved my problem, but I want to know if there is an EXPLICIT limit and I cannot find any information related.

Thanks for your help.

XAML WPF assembly not loading into designer


Win 7, VS 2008 SP1, .NET 3.5 Sp1

I have an error on my machine only, but has no complaints on other similar machines. I have a separate xaml file in my local assembly, so I make the declaration in my main XAML file :

A local type xaml is used (in a grid) and is in the body of the main xaml file :
<local:PLTButtonPanel x:Name="BtnPanel" HorizontalAlignment="Left" VerticalAlignment="Top" .....MORE STUFF..../>

This error is displayed when trying to load the designer :
Error 1 Assembly 'MyAppName' was not found. Verify that you are not missing an assembly reference. Also, verify that your project and all referenced assemblies have been built. H:\usr\src\CS\MyAppName\MyAppName\MainFrameWindow.xaml 6
Error 2 The type 'local:PLTButtonPanel' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. H:\usr\src\CS\MyAppName\MyAppName\MainFrameWindow.xaml 220

When I compile, the erros go away, the app runs fine, BUT the Designer never loads the UI into view. It has no problem on ther identically configured machines.

Any ideas what is not set properly ?

XAML namespace clashes: Is there a global:: qualifier in XAML?


My existing XAML code compiles fine and runs fine. However when I add a new reference to the project then it fails to compile.

Basically I have a reference in my XAML


When I add a project reference to a new assembly (MyCompany.Service.Devices.MyCompany) then the XAML starts looking in the whong place to load it's UI componants.

In C# I would simply add a global qualifier 


but this doesn't work in XAML. Is there something I can do to specify a global qualifier?




WorkflowDesigner and compiled Activities vs. XAML


Let's say I have an Activity that is compiled in some assembly:  MyAssembly.MyWorkflow and I have its xaml file:  MyWorkflow.xaml.  

In a rehosted designer, if I do workflowDesigner.Load("MyWorkflow.xaml"), the workflow is loaded and displayed properly, with all the activity design surfaces displayed.

However, if I do workflowDesigner.Load(new MyWorkflow()), the workflow is loaded but it is not displayed properly.  There is a single activity without a designer.

What do I have to do in order to get the second Load to have the same design time experience as the first?

SharePoint 2007 Workflows - Things to Consider Before You Start

SharePoint 2007 (MOSS) utilizes the Workflow Foundation (WF) to enable workflows on lists and content types. But before you start doing cartwheels there are few things you should know before you get started. The experiences I'll be discussing are not from book smarts but from building real MOSS solutions that are in production today.

What's new in XAML of .NET 4.0

With .NET 4.0 Microsoft will bring up a improved version of XAML. This arcitle shows you the language enhancements they made.
Easy Object References with {x:Reference}

Built-in Types

Generics in XAML with x:TypeArguments

Support for Arbitrary Dictionary Keys

Use of Non-Default Constructors with x:Arguments

Use of Static Factory Methods with x:FactoryMethod

Calculate distance, bearing and more between Latitude/Longitude points

This page presents a variety of calculations for latitude/longitude points, with the formulæ and code fragments for implementing them.

All these formulæ are for calculations on the basis of a spherical earth (ignoring ellipsoidal effects) - which is accurate enough* for most purposes. [In fact, the earth is very slightly ellipsoidal; using a spherical model gives errors typically up to 0.3% - see notes for further details].
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend