Visual Studio 2017 Winforms Designer 缓存在哪里?

人气:639 发布:2022-10-16 标签: winforms visual-studio windows-forms-designer visual-studio-2017

问题描述

当我试图打开我的一个表单时,我从 Visual Studio Designer 收到了一些恼人的错误(无法从程序集 y 加载类型 x,即使程序集 y 明确包含类型 x;项目构建并运行良好).对我来说,这看起来像是 Visual Studio Designer 缓存问题.我环顾四周,似乎 Visual Studio Designer 使用了 ShadowCache,通常位于

I'm getting some annoying errors from Visual Studio Designer when trying to open one of my forms (Could not load type x from assembly y, even though assembly y clearly contains type x; the project builds and runs fine). It looks like Visual Studio Designer cache issue to me. I looked around and it seems like Visual Studio Designer uses a ShadowCache, normally found at

C:Users\%UserName%AppDataLocalMicrosoftVisualStudio15.0_6d397e1aDesignerShadowCache

C:Users\%UserName%AppDataLocalMicrosoftVisualStudio15.0_6d397e1aDesignerShadowCache

但是,该文件夹是空的.这向我表明必须有一些其他缓存位置,因为我正在使用设计器进行其他一些事情,所以设计器缓存位置至少应该有一些东西......

However, that folder is empty. This suggests to me that there must be some other cache location, since I am using designer for some other things, there should at least be something in the designer cache location...

推荐答案

要清理 windows 窗体设计器项目程序集,您需要删除位于 %userprofile% 的 ProjectAssemblies 文件夹的子文件夹appdatalocalMicrosoftVisualStudio 位于文件夹之一下,具体取决于您的 Visual Studio 版本.

To clean windows forms designer project assemblies, you need to delete subforlders of ProjectAssemblies folder which is located in %userprofile%appdatalocalMicrosoftVisualStudio under one of the folders depending to your visual studio version and edition.

以我为例:

%userprofile%appdatalocalMicrosoftVisualStudio15.0_a26f780eProjectAssemblies

如果您查看文件夹,您会看到包含项目程序集的子文件夹.

If you look in the folder, you see subfolders containing assemblies of your projects.

460