Mubshir Raza Ali

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.

The path is not of a legal form.

Hide

at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)
at System.IO.Path.GetFullPathInternal(String path)
at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AddProjectDependencies(Project project)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly()
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)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name)
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.GetType(String typeName)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
1.When i open a form above error occurs
2.When i close it and open it again it loads successfuly

How can i fix this issue.



Re: Windows Forms Designer The path is not of a legal form.

Peter Ritchie

Does the adivce from the first line--to rebuild the application--not fix the problem

If not, do you know what filename it is complaining about e.g. what file are you trying to load in the Designer






Re: Windows Forms Designer The path is not of a legal form.

Omer van Kloeten

The problem is that the form's designer is trying to locate one of the types referenced by your form and is unable.
This means that your project probably wasn't built since the reference was added or that the project file has somehow been changed.

If building the solution doesn't work, try going over the references in the project and looking at where their locations are and verifying that they all actually exist.





Re: Windows Forms Designer The path is not of a legal form.

Mubshir Raza Ali

Well thanks Guys,

As i said when i open it above error occurs, at the same time when i close form and open it again then its shown fine, without compling etc...

How can i fix it permanatnly, as i have to close and then open form most of the time

Thanks.






Re: Windows Forms Designer The path is not of a legal form.

Matt Lin

hi,Mubshir

is the base class of the form is a custom form type

if the base class have a exception throwed at construct,the designer will can't load the design surface view accurately .\






Re: Windows Forms Designer The path is not of a legal form.

Lummie

I just got this when I had assemblies in the solution that were project references and I had unloaded them to save compilation time.

I got this error trying to view my user control in design.

Reloaded the projects and did a build, all worked again.

This might not eb the same cause but I thought I'd leave this comment for others.




Re: Windows Forms Designer The path is not of a legal form.

vbNullString

Hmm... I'm having the same issue. I could even rebuild the whole solution, but when I open user control in design mode, I get the same error. Has anyone had any luck with this issue



Re: Windows Forms Designer The path is not of a legal form.

bphillips76

Make sure the controls and components referenced by the form are contained in a separate project otherwise you will create a circular dependency that is not easy to fix.



Re: Windows Forms Designer The path is not of a legal form.

PaulvZyl

I also recieve this error message, and it also dissapears when I close the form and open it up again. But it reappears when I close the solution and open that up again. The problem started when I accidentally deleted the Forms .resx file.



Re: Windows Forms Designer The path is not of a legal form.

BrandoBro

I too had this problem and I was able to recover from it. The problem I had was that I was trying to change a property of a Custom Control. I did not write the control so I dont know if it was an issue of the property not being defined exactly. All I had to do was delete the line of code from the .cs file and it was all good. Good luck.





Re: Windows Forms Designer The path is not of a legal form.

Melt16

Try cleaning the project using the right-click 'Clean Option' in Solution Explorer
.
If that doesn't work make sure in the Build Configuration Manager that all references the Form Designer requires are being built correctly.

i.e If you have a custom control as a referenced project, make sure the custom control is being compiled build time. I have seen issues with the designer if I have not included my custom control library in the build.





Re: Windows Forms Designer The path is not of a legal form.

Tabas

Seem like the function GetFullPathInternal() has some issues or does not working fine. This issue was experimented by me when a pipe (|) was placed into the assembly manifest (assemblyinfo file). Meybe you have some 'rare' characters in the path for your local user, in your pc. Like you know, VS2005 store the assembly history in folders into the C:\Documents and Settings\UserLogged\Application Data folder or maybe you don't have full access to this folder. Delete all folder for your product in this path. You MUST to delete the project related folders from C:\Documents and Settings\UserLogged\Local Settings\Application Data too!.

The assemblies in the folder C:\Documents and Settings\UserLogged\Local Settings\Application Data\Microsoft\VisualStudio\8.0\ProjectAssemblies must be deleted too!

See this feedback for details about this issue:

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=233592

Regards





Re: Windows Forms Designer The path is not of a legal form.

Juan Talavera

I got the same issue, I've tried all the sugestions but none of them fixed the problem permanently, deleting all files from those directories solves it temporaly. Has any one found some definitive solution for this issue




Re: Windows Forms Designer The path is not of a legal form.

Precurse

Hello, me too got the same problem than everyone while i was creating my own user control.
I sorted it out by founding that the Load event was called at desing time, and that i was using object not initialize at desing time but were a run time, so at run time it was working fine but at desing time it was just crashing.







Re: Windows Forms Designer The path is not of a legal form.

Peter Holmdahl

This was helpful yes and no.
Everything was built and in its place. Then I deleted one project dll, just to see what error message I would get. To my suprize this fixed the problem and the designer worked again.