今天早上,我在打开Visual Studio解决方案时遇到了一个问题,当我试图运行它时,它说:
没有找到与约束契约名称匹配的导出
我该如何解决这个问题?
今天早上,我在打开Visual Studio解决方案时遇到了一个问题,当我试图运行它时,它说:
没有找到与约束契约名称匹配的导出
我该如何解决这个问题?
当前回答
此问题可以通过删除或清除%AppData%\..\Local\Microsoft\VisualStudio\11.0\ComponentModelCache中的所有文件夹和文件来解决
这实际上清除了Visual Studio组件模型缓存。
在Windows 7的机器上,路径是不同的。当您在运行对话框中输入%appdata%时,它会打开文件夹C:\Users\<username>\ appdata \Roaming。
点击“向上”按钮导航到父文件夹并选择文件夹“Local”。
最终路径:C:\Users\<username>\AppData\Local\Microsoft\VisualStudio\11.0\ComponentModelCache
其他回答
两年后,我收到了同样的错误信息。 这次是一个不同的问题,与。net Core dnx有关。
我在Stack Overflow上找不到答案,但有一个GitHub问题包含一个解决方案:https://github.com/aspnet/Home/issues/1455
下面是解决方案中最重要的部分:
Delete the entire C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\DNX directory. (As far as I understand, it belongs to the old version of ASP.NET Core RC1, which for some reason is still shipped even with Visual Studio 2015 Update-3). Delete the C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\14.0\devenv.exe.config file. Run the Developer Command Prompt for Visual Studio 2015 as Administrator, and execute the devenv /setup command. The new devenv.exe.config file is generated. This time there are many assemblies that refer to the C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\DotNet directory. Run the Visual Studio 2015 and check that it shows the Microsoft .NET Core Tools (Preview 2) 14.1.20624.0 in the Help => About Microsoft Visual Studio menu.
感谢olegbroov在GitHub上的帖子,他发现了这一点。
我有Windows 7 x64和Windows 8(预览安装)的第二个分区。在使用Windows Phone的Microsoft Visual Studio Express 2012时,我也遇到了同样的问题。但是ComponentModelCache可以在这里找到:
本地用户目录C: \ \ Jayaram AppData \ \微软\ VPDExpress 11。
当我尝试使用命令提示符时,我无法删除或重命名,因为我得到了“访问被拒绝”的消息:
管理员:VS2012 X64 CrossToolsCommandPrompt
此问题可以通过删除或清除%AppData%\..\Local\Microsoft\VisualStudio\11.0\ComponentModelCache中的所有文件夹和文件来解决
这实际上清除了Visual Studio组件模型缓存。
在Windows 7的机器上,路径是不同的。当您在运行对话框中输入%appdata%时,它会打开文件夹C:\Users\<username>\ appdata \Roaming。
点击“向上”按钮导航到父文件夹并选择文件夹“Local”。
最终路径:C:\Users\<username>\AppData\Local\Microsoft\VisualStudio\11.0\ComponentModelCache
删除ComponentModelCache对我不起作用。重新安装VS 2019要感谢微软支持线程上的建议。
细节
这似乎是一个已知的错误,微软已经修复了(截至2020年7月1日) 使用Visual Studio安装程序从VS2019 Pro 16.2(我想是?)升级到16.4.2后经验丰富 试图启动nuget控制台和nuget包管理器时显示错误
无需重命名或删除整个文件夹:
(%AppData%\..\Local\Microsoft\VisualStudio\11.0\ComponentModelCache)
只需重命名或删除上述位置中的Microsoft.VisualStudio.Default.cache文件。