An error occurred while parsing EntityName. Line 2

Topics: CAB & Smart Client Software Factory
Jul 13, 2005 at 7:13 PM
originally posted by: Autocrat

An error occurred while parsing EntityName. Line 2, position 74.

Generally this happens when you have placed invalid, unparsable characters within your XML. But I can't work out which document this is occuring in? Especially since it says line 2, it can't be the resx file because it is full of comments for the most part.

Strangely enough, I am receiving a different call stack when I receive the error in:
a) BankTellerMainView
at System.Reflection.Assembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly, String description)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchProjectEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, ReferenceType refType)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
...cut

b) CustomerQueueView
at System.ModuleHandle.ResolveType(Int32 typeToken, RuntimeTypeHandle* typeInstArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInstCount)
at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, Module decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, RuntimeMethodHandle& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
...cut

And finally,
c)UserInfoView
at System.ModuleHandle.ResolveType(Int32 typeToken, RuntimeTypeHandle* typeInstArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInstCount)
at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, Module decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, RuntimeMethodHandle& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.GetCustomAttributes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
...cut

Can someone please advise?
Jul 13, 2005 at 8:29 PM
originally posted by: Autocrat

Just to follow up some more information about this...

To fix the problem so that it removes the error from all views except the shell, just delete the quickstart and do a repair of the tech preview msi.

The problem stems from opening the BankShellForm.cs in the designer. Must be some type of roundtrip problem that is causing the others to mess up.

So if you don't touch BankShellForm.cs you wont hit this problem.
Also, make sure you build the solution before playing with any of the other views in design or you will get another nasty design time error.

It's got me buggered - I cant work out what file is causing the problem, or maybe it's just a VSTS designer bug? If so, what is that form doing that is causing it?
Jul 13, 2005 at 9:18 PM
originally posted by: Autocrat

Another discovery...

Basically, I have been able to focus it down on:
this.mainShellWorkspace = new Microsoft.ApplicationBlocks.CompositeUI.WinForms.DeckWorkspace();

Whenever a workspace gets initialized within InitializeComponent, everything goes pair shaped within the designer... I have tried different types of workspaces and they all seem to do it...
What's the workspace doing that is causing the designer so much grief? I tried investigating the workspace code, but it seems alright?

Any ideas?
Jul 14, 2005 at 3:20 AM
originally posted by: headlam

Matthew, this is definitely a nasty problem. I was able to fix the problem by simply moving my install from the “C:\Program Files” folder to another location. In my case I used C:\Temp for testing.
Jul 14, 2005 at 3:41 AM
originally posted by: Autocrat

Yep, you are right. This is a quick way to fix the problem.

I think this is only a bandaid though, and I would be really interested in what causes the problem - whether it's a VSTS bug, or something dodgy in the CAB structure?
Perhaps it has something to do with where it references the src, because I had changed this also.
Jul 15, 2005 at 5:13 AM
originally posted by: BradWilsonMSFT

I can reproduce the problem here, and we're trying to track it down...

Thanks!
Jul 29, 2005 at 3:01 PM
originally posted by: ppng

Just need to remove the '&' in the default instalation path. XML parser does not like &. -- Tom
Aug 17, 2005 at 3:49 AM
originally posted by: PMANET

C:\Program Files\Microsoft patterns & practices\Composite UI Application Block Tech Preview 1
Sep 6, 2005 at 8:09 PM
originally posted by: Beskur

Thanks for the post this was driving me nuts.