Microsoft Visual Studio designer cannot open and reports the error "The designer could not be shown for this file because none of the classes within it can be designed."

I had a problem today whereby I couldn't open the Visual Studio form designer and received the following error viewing any form or user control.

The designer could not be shown for this file because none of the classes within it can be designed. 

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 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload) 


The solution was to rename the ProjectAssemblies directory in the appropriate Visual Studio directory and reopen the project. It seems there was some kind of issue with the project assemblies cache.

%LOCALAPPDATA%\Microsoft\VisualStudio\16.0_72ecbfa4\ProjectAssemblies

Comments

Popular posts from this blog

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

TFTPD32 or TFTPD64 reports Bind error 10013 An attempt was made to access a socket in a way forbidden by its access permissions.

Windows Server 2019 desktop icons such as My Computer, Windows cannot access the specified device, path, or file.