"Illegal Characters in Path" an error while opening the C# Form in VS 2005


  • Hi,
    When I trying to open my Form (Design) in VS2005, Iam getting an error like "Illegal Characters in Path". Actually my form is developed in VS 2003, and that was migrated by my coleague into VS 2005, In his system it is working fine.
    Recently I upgraded with VS 2005 in my system, That migrated form cannot visible in my VS2005 design view, Iam able to view the code and also able to Run the application, but In design view Iam unable to View the form, instead form Iam getting an error like:

    One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.

    Illegal characters in path.


    at System.IO.Path.CheckInvalidPathChars(String path)
    at System.IO.Path.Combine(String path1, String path2)
    at Microsoft.VisualStudio.AssemblyEnumerationService.VSAssemblyEnumerator.System.Collections.IEnumerator.MoveNext()
    at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchSDKEntries(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)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name)
    at System.ComponentModel.TypeDescriptor.CreateDesigner(IComponent component, Type designerBaseType)
    at System.ComponentModel.Design.DesignSurface.CreateDesigner(IComponent component, Boolean rootDesigner)
    at Microsoft.VisualStudio.Design.VSDesignSurface.CreateDesigner(IComponent component, Boolean rootDesigner)
    at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
    at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name)
    at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
    at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeInstance(IDesignerSerializationManager manager, Type type, Object[] parameters, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.ComponentCodeDomSerializer.DeserializeInstance(IDesignerSerializationManager manager, Type type, Object[] parameters, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
    at System.ComponentModel.Design.Serialization.CodeDomSerializer.DeserializeStatementToInstance(IDesignerSerializationManager manager, CodeStatement statement)
    at System.ComponentModel.Design.Serialization.CodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject)
    at System.Windows.Forms.Design.ControlCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject)
    at Infragistics.Shared.Serialization.UltraCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject)
    at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.DeserializeName(IDesignerSerializationManager manager, String name, CodeStatementCollection statements)

    Wednesday, April 04, 2007 9:32 AM

All replies



    Take backup of following registry key and replace them in your pc. But it is not working for me. But you can try it.



    And Replace it in your PC


    see the following thread i am also facing the same problem




    Wednesday, August 08, 2007 11:28 AM
  • Hi,

    for me this problem was resolved, this is really a Bad Bad error, I suffered with this alot.

    If you use any third party controls, that problem will occur, because of some license issues,

    to overcome the error please do the following steps

    step 1:Add reference -->Design dll's of that controls need to be referenced to the project

    step 2: open the form in design view (the one which showing the Illegal error).

    step 3: delete .Resx file

    step 4: then again open the form.

    I think this process might help you





    Wednesday, August 08, 2007 1:35 PM

    Hi Jyothi,


    There is no third party control on the form. Form is empty and in the project also no third party control is referenced. I tried deleting .Resx file, reinstalling Compact framework .... but not able to solve the problem. You can visit following URL if you want to earn points.


    Do you have any other solution ?






    Thursday, August 09, 2007 4:41 AM