Carol He

Hi,

Could anyone tell me how can I avoid that virtual studio adds version no. for activities into xoml file It is tedious that I had to manually modify the version no. in xoml file when I change the version no. .



Re: Windows Workflow Foundation Not add version no. into xoml file

Tom Lake - MSFT

In the AssemblyInfo file uncomment the following line for C#:

[assembly: System.Workflow.ComponentModel.Serialization.XmlnsDefinition("http://schemas.com/ActivityLibrary3", "ActivityLibrary3")]

Or for VB use below; to see the AssemblyInfo file in VB you need to click the Show All Files button while the project is selected and expand My Project:

<Assembly: System.Workflow.ComponentModel.Serialization.XmlnsDefinition(http://schemas.com/ActivityLibrary3, "ActivityLibrary3")>

This will put into the Xoml file:

xmlns:ns0="http://schemas.com/ActivityLibrary3"

Instead of:

xmlns:ns0="clr-namespace:ActivityLibrary3;Assembly=ActivityLibrary3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"






Re: Windows Workflow Foundation Not add version no. into xoml file

Carol He

Hi Tom:

Thanks for your reply. It can work. But I encountered one problem.

Although XmlnsDefinition can remove the namespace, vs 2005 just works for the first namespace.

For example, there are several namespace in one assembly, I defined them into AssemblyInfo.cs like these:

[assembly: System.Workflow.ComponentModel.Serialization.XmlnsDefinition("http://schemas.com/A", "A")]

[assembly: System.Workflow.ComponentModel.Serialization.XmlnsDefinition("http://schemas.com/B", "B")]

But when I drag my custom activities to designer, I just can see "xmlns:ns0="http://schemas.com/A""

can not see "xmlns:activities0="http://schemas.com/B""

How can I do

Thanks

Carol





Re: Windows Workflow Foundation Not add version no. into xoml file

Tom Lake - MSFT

When I put in the AssemblyInfo.cs:

[assembly: System.Workflow.ComponentModel.Serialization.XmlnsDefinition("http://schemas.com/ActivityLibrary3", "ActivityLibrary3")]

[assembly: System.Workflow.ComponentModel.Serialization.XmlnsDefinition("http://schemas.com/ActivityLibrary4", "ActivityLibrary4")]

I get the following when I add activities from each namespace to a workflow:

<SequentialWorkflowActivity x:Class="WorkflowConsoleApplication1.Workflow1" x:Name="Workflow1" xmlns:ns0="http://schemas.com/ActivityLibrary3" xmlns:ns1="http://schemas.com/ActivityLibrary4" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow">

<ns0:Activity1 x:Name="activity11">

<ns1:Activity2 x:Name="activity21" />

</ns0:Activity1>

</SequentialWorkflowActivity>

Do you have the Activities’ assembly in the same project or solution If either try removing all instances of the custom activities, do Build Clean, close and re-open VS, build the solution and re-add the activities.






Re: Windows Workflow Foundation Not add version no. into xoml file

Carol He

Hi Tom:

I found the problem. It was due to I used one ActivityToolboxItem to drag several activities to designer. That means there was one ActivityToolboxItem. Its CreateComponentsCore() will return several activities so that I can use it to drag several activities to designer.

But if I just drag one activities to designer, the namespaces are ok.

Do u have any idea for my scenaro

Regards

Carol