- type some text to the 'Name' edit
- drag a 'Sequence' activity from toolbox
- drag a 'Delay' activity
- save and close the DetailView
- open the created workflow
- open the 'Designer' tab and delete the 'Delay' activity
- save changes - exception occurs:
System.Xml.XmlException: 'sads:DebugSymbol.Symbol' is a duplicate attribute name. Line 13, position 109.
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32 linePos)
at System.Xml.XmlTextReaderImpl.AttributeDuplCheck()
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Activities.Debugger.XmlReaderWithSourceLocation.Read()
at System.Xaml.XmlCompatibilityReader.Read()
at MS.Internal.Xaml.Parser.XamlScanner.DoXmlRead()
at MS.Internal.Xaml.Parser.XamlScanner.Read()
at MS.Internal.Xaml.Parser.XamlPullParser.<P_NonemptyPropertyElement>d__42.MoveNext()
at MS.Internal.Xaml.Parser.XamlPullParser.<P_PropertyElement>d__35.MoveNext()
at MS.Internal.Xaml.Parser.XamlPullParser.<P_ElementBody>d__23.MoveNext()
at MS.Internal.Xaml.Parser.XamlPullParser.<P_Element>d__7.MoveNext()
at MS.Internal.Xaml.Parser.XamlPullParser.<Parse>d__0.MoveNext()
at MS.Internal.Xaml.NodeStreamSorter.MoveNext()
at System.Xaml.XamlXmlReader.Read()
at System.Activities.Debugger.XamlDebuggerXmlReader.Read()
at System.Activities.XamlIntegration.DynamicActivityXamlReader.Read()
at Microsoft.Activities.Presentation.Xaml.ActivityTemplateFactoryBuilderReader.Read()
at Microsoft.Activities.Presentation.Xaml.ViewStateXamlHelper.StripViewStateElement(XamlReader inputReader, Dictionary`2& viewStateInfo, Dictionary`2& viewStateSourceLocationMap)
at Microsoft.Activities.Presentation.Xaml.ViewStateXamlHelper.ConvertViewStateToAttachedProperties(XamlReader inputReader, ViewStateIdManager idManager, Dictionary`2& viewStateSourceLocationMap)
at Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.DeserializeString(String text, DeserializationMode mode, IList`1& loadErrors, Dictionary`2& sourceLocations)
at Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.DeserializeString(String text, IList`1& loadErrors, Dictionary`2& sourceLocations)
at Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.SerializeToString(Object obj, String fileName)
at System.Activities.Presentation.WorkflowDesigner.SerializeToString(Object obj, String fileName)
at System.Activities.Presentation.WorkflowDesigner.WriteModelToText(String fileName)
See also: WF4.5 Rehosted Workflow Designer issue.
Workflow - XmlException 'sads:DebugSymbol.Symbol' is a duplicate attribute name.' occurs when saving changes in WorkflowDesigner in .NET FW 4.5
Answers approved by DevExpress Support
We have reported this bug to Microsoft:
https://connect.microsoft.com/VisualStudio/feedback/details/786503/
I would ask every one who is facing the same issue to please upvote (see the green arrow at left) the aforementioned MS Connect item and feel free to post workaround solutions there, if any. Thanks for your cooperation in advance!
We are closing this ticket for now, and will reactivate it once we receive any fix from Microsoft.
Starting with version 12.2.9 (or after installing this hot fix), the aforementioned problem should not occur with our product, because we have introduced a static DevExpress.ExpressApp.Workflow.Win.WorkflowDesignerControlBase.CanSetTargetFramework45 property (it's false by default) that disables the problematic features in the rehosted workflow designer.
Finally, we sincerely apologize for all the inconvenience here.
Dennis, you mentioned that in 12.2.9 the problem is solved. Because we are using the workflow much, and also are right now busy with the upgrade to 12.2.8, can you give an estimation on when 12.2.9 is released?
Or is it ok to use the ByPass as provided by Dan in the 12.2.8 ?
@Peter: I said that we disabled workflow features in version 12.2.9. It should be out in a few weeks. I am afraid I cannot tell you the exact date for this maintenance update. If you cannot wait, you can use the hot fix link I posted above. This hot fix contains the aforementioned changes.
I have introduced workaround code into XAF that allows you to avoid this issue. Assign the 'true' value to the WorkflowDesignerControlBase.CanSetTargetFramework45 property to enable FW4.5 features and see whether or not it improves behavior in your environment. This change will be included in the next public release/update (v12.2.11/v13.1.5). Assign the 'false' value to the WorkflowDesignerControlBase.RemoveFramework45DebugSymbol property to disable it if necessary (it is enabled by default). Note that this issue is not fixed in the WF code, and we are still waiting for a native solution from the WF team.
This feature is required for us to.
Regards,
Emmanuel Desfosses
Thank you for your message. We have not found a solution yet. You will be notified once we have any result.
Emmanuel,
As a disgusting workaround in the meantime, I have created a workflow class that extends XpoWorkflowDefinition and handled the OnChanged method. It now looks something like this:
private bool filteringxaml = false;
protected override void OnChanged(string propertyName, object oldValue, object newValue)
{
base.OnChanged(propertyName, oldValue, newValue);
//HACK!
if (!IsLoading && !IsSaving)
{
if (propertyName == "Xaml" && !filteringxaml)
{
try
{
filteringxaml = true;
string starttag = "<sads:DebugSymbol.Symbol>";
string endtag = "</sads:DebugSymbol.Symbol>";
string val = newValue as string;
if (val.Contains(starttag) && val.Contains(endtag))
{
val = val.Substring(0, val.IndexOf(starttag) + starttag.Length) + val.Substring(val.IndexOf(endtag));
this.Xaml = val;
}
}
finally
{
filteringxaml = false;
}
}
}
}
I'm not claiming that it's pretty… but it allows me to get a workflow designed in the meantime until a proper fix comes out.
This workaround works for the designer only. The workflow server is still generating an error when trying to run my workflow:
Cannot set unknown member '{http://schemas.microsoft.com/netfx/2009/xaml/activities}TextExpression.NamespacesForImplementation'.
26.03.13 09:52:24.577 4 ================================================================================
The error occurred:
Type: XamlObjectWriterException
Message: Cannot set unknown member '{http://schemas.microsoft.com/netfx/2009/xaml/activities}TextExpression.NamespacesForImplementation'.
Data: 0 entries
Stack trace:
at System.Xaml.XamlObjectWriter.WriteStartMember(XamlMember property)
at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
at System.Xaml.XamlServices.Load(XamlReader xamlReader)
at System.Activities.XamlIntegration.ActivityXamlServices.Load(XmlReader xmlReader)
at System.Activities.XamlIntegration.ActivityXamlServices.Load(TextReader textReader)
at OmegaWorkflowActivityLibrary.Service.CustomHostManagerActivityProvider.Manager_HostOpening(Object sender, EventArgs e) in Solution1/CustomHostManagerActivityProvider.cs:line 25
at DevExpress.Workflow.WorkflowHostManager.OpenHosts()
at Solution1WorkflowServer.WorkflowServerManager.StartServer()
Thank you for the additional information, Dave.
I have a similar problem and it seems to be the same cause. (.NET 4.0 / DX Components Version 12.2.7.0)
After workflow create->save->close->open->change the DisplayName of GetObjectByKey<String> in an ObjectSpaceTransactionScope->save
I get the following error:
System.Xaml.XamlDuplicateMemberException: Die Symbol-Eigenschaft wurde bereits für "ObjectSpaceTransactionScope" festgelegt.
bei System.Xaml.XamlObjectWriter.Logic_DuplicatePropertyCheck(ObjectWriterContext ctx, XamlMember property, Boolean onParent)
bei System.Xaml.XamlObjectWriter.WriteStartMember(XamlMember property)
bei Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.<>c__DisplayClassd.<TransformAndGetPropertySourceLocation>b__c(XamlObjectWriter objectWriter)
bei Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.UsingXamlWriter[T](T xamlWriter, Action`1 work)
bei Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.TransformAndGetPropertySourceLocation(XamlReader reader, SourceTextScanner sourceTextScanner, SourceLocationFoundCallback sourceLocationFoundCallback)
bei Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.DeserializeString(String text, DeserializationMode mode, IList`1& loadErrors, Dictionary`2& sourceLocations)
bei Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.DeserializeString(String text, IList`1& loadErrors, Dictionary`2& sourceLocations)
bei Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.SerializeToString(Object obj, String fileName)
bei System.Activities.Presentation.WorkflowDesigner.WriteModelToText(String fileName)
Thanks for the update, Jerome. We will take this information into account.
Any movement on this issue? We are suffering without workflows now and if they aren't going to be fixed in the near future, then I'm going to have to implement a custom solution…
Please let me know - Thanks!
I'm with Dave on this. I'm now developing my workflow system using an older version, but I'm coming to the point where I'd like to put stuff together in a project I'm keeping relatively up to date with later versions.
Guys, I am afraid we do not have any news on this issue, because as I indicated in the original description, it appears to be an issue in the rehosted Workflow designer itself or .NET 4.5, which we cannot easily bypass on our side. Refer to the http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/f50cdd1b-4a1e-4fb8-bc6d-ef45d572a353/ thread for more details on this. This problem was revealed by Microsoft customers as well.
Hi Dennis. My concern is that the rehosted designer worked in 4.0 and broke in 4.5. I realize there were requests to include features of 4.5 such as (http://www.devexpress.com/Support/Center/p/Q442195.aspx) but now it's broken.
Rather than provide a broken module, is it possible to roll it back to 4.0 until the rehosted designer is fixed from MS?
I apologize for such a long delay in processing this issue. I will check for possible solutions today and immediately notify you about the results.
I have disabled WF4.5 support in the WorkflowDemo application, and in my scenario the modified workflow is saved without errors. To check this approach right now, include the following controller in your application:
public class DisableWF45Controller : Controller { static DisableWF45Controller() { WorkflowDesignerControl.WorkflowDesignerCreated += WorkflowDesignerControl_WorkflowDesignerCreated; } private static void WorkflowDesignerControl_WorkflowDesignerCreated(object sender, WorkflowDesignerCreatedEventArgs args) { Type designerConfigurationServiceType = null; foreach(Type t in args.WorkflowDesigner.Context.Services) { if(t.FullName == "System.Activities.Presentation.DesignerConfigurationService") { designerConfigurationServiceType = t; } } if(designerConfigurationServiceType != null) { object designerConfigurationService = args.WorkflowDesigner.Context.Services.GetService(designerConfigurationServiceType); if(designerConfigurationService != null) { System.Reflection.PropertyInfo targetFrameworkNameProperty = designerConfigurationServiceType.GetProperty("TargetFrameworkName"); if(targetFrameworkNameProperty != null) { try { targetFrameworkNameProperty.SetValue(designerConfigurationService, new System.Runtime.Versioning.FrameworkName(".NETFramework", new Version(4, 0)), new object[] { }); } catch { } } } } } }
For more details, see Workflow Foundation (WF 4.5) - Designer Improvements.
We will see how to simplify this adjustment. I will notify you of a new solution when it is ready.
With the next update, WF4.5 support will be disabled by default. You will need to make additional changes to enable it if necessary. This looks like a breaking change, but currently we consider it required.
Anyway, we will contact WorkflowDesigner developers to get their opinion regarding this issue.
I have introduced the CanSetTargetFramework45 property to the WorkflowDesignerControlBase class. Its default value is 'false'.
This property is static, so you can use it directly in your 'program.cs' file:
static void Main(string[] arguments){ ... WorkflowDesignerControlBase.CanSetTargetFramework45 = true;
This change will be included in the v12.2.9 update. Contact us if you want to obtain an intermediate build, and we will prepare it for you.
Any idea when the new update will be released?
We have not yet established the date of the official update, but you can use the following intermediate build containing the aforementioned change:
http://downloads.devexpress.com/Share/DXP/130424/DXperience-12.2.8.13114.exe
We have reported this bug to Microsoft:
https://connect.microsoft.com/VisualStudio/feedback/details/786503/
I would ask every one who is facing the same issue to please upvote (see the green arrow at left) the aforementioned MS Connect item and feel free to post workaround solutions there, if any. Thanks for your cooperation in advance!
We are closing this ticket for now, and will reactivate it once we receive any fix from Microsoft. In the meantime, you can use the aforementioned WorkflowDesignerControlBase.CanSetTargetFramework45 workaround.
+1'd
Thanks, Dave!