今天早上,我在打开Visual Studio解决方案时遇到了一个问题,当我试图运行它时,它说:

没有找到与约束契约名称匹配的导出

我该如何解决这个问题?


当前回答

在Visual Studio 2013中重新安装IntelliJ IDEA和ReSharper for c#后,我得到了这个错误。

首先,我得到了一个错误的问题与扩展,在这之后,我得到了这个错误:

"未找到与约束契约名称匹配的导出"

我只是删除了ComponentModelCache文件夹并解决了这个错误。

其他回答

删除组件模型缓存对我不起作用(好吧,上面给出的相对目录在我的机器中不存在)。相反,我安装了Visual Studio 2012 Express的扩展。菜单工具→扩展和更新…→在线→任意选择然后下载。这显然使缓存无效,导致Visual Studio重新构建它。

这是我的消息来源。

我在Windows 8.1的Visual Studio Express 2013上也遇到了同样的问题。

不幸的是,没有“ComponentModelCache”文件夹 当地% AppData % . . \ \ Microsoft \ VisualStudio \ 12.0 \ ComponentModelCache。

我找到了“ComponentModelCache”文件夹 . . \用户【用户名】微软\ AppData \当地\ \ WDExpress \ 12.0

然后把这个文件夹从那里移走解决了这个问题。

两年后,我收到了同样的错误信息。 这次是一个不同的问题,与。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上的帖子,他发现了这一点。

我在微软发布了一些更新后遇到了类似的问题(其中一部分是关于. net framework 4.5的)。

在互联网上,我得到了以下微软知识库文章的链接:

更新Microsoft Visual Studio 2012 (KB2781514)

这对我很管用。

对于Visual Studio 2012和更高版本,解决方案必须删除ComponentModelCache文件夹的内容:

C:\Users\[username]\AppData\Local\Microsoft\WDExpress\11.0\ComponentModelCache

Visual Studio 2013

C:\Users\[username]\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache