错误“在 Visual Studio 中找不到元数据文件 '...Releaseproject.dll'" [英] Error "Metadata file '...Releaseproject.dll' could not be found in Visual Studio"

查看:59
本文介绍了错误“在 Visual Studio 中找不到元数据文件 '...Releaseproject.dll'"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我开始随机收到这条消息:

Recently I started to get this message randomly:

在 Visual Studio 中找不到元数据文件...Releaseproject.dll"

Metadata file '...Releaseproject.dll' could not be found in Visual Studio

我有一个包含多个项目的解决方案.当前构建模式为Debug,所有项目的配置都设置为Debug.但是当我尝试运行主项目时 - 有时它会给我一些错误,所有这些都是找不到元数据文件'...ReleaseprojectX.dll'" - 而且,看,它说的是 RELEASE文件夹,虽然当前模式是调试.为什么?我试图在所有解决方案文件中搜索对ReleaseprojectX.dll"的引用,我在 ResolveAssemblyReference.cache 文件中找到了一个.

I have a solution with several projects in it. The current build mode is Debug and all projects' configurations are set to Debug. But when I try to run the main project - sometimes it gives me a few errors, all of which are "Metadata file '...ReleaseprojectX.dll' could not be found" - and, look, it says about RELEASE folder, though current mode is Debug. Why? I tried to search for reference to "ReleaseprojectX.dll" inside all solution files, and I found one in ResolveAssemblyReference.cache file.

我在互联网上进行了很好的搜索,发现了一些有类似问题的人,但没有解决方案,或者至少没有可行的解决方案.

I made a good search over the Internet and found a few people with a similar problem, but there was no solution, or at least no working solution.

我试图删除对这些项目的引用并阅读它们,但过了一段时间我又开始收到这些错误.

I tried to delete references to those projects and read them, but in some time I start getting these errors again.

这似乎是一个错误.为什么我一直使用Debug模式时会在Release文件夹中搜索引用的项目?

It seems like a bug. Why does it search for referenced projects in Release folders when I always use Debug mode?

PS. 对于遇到此问题的人:我无法以简单的方式解决它.只有在我重新安装 Windows 后它才消失:(

PS. For those who met this problem: I couldn't solve it in an easy way. It disappeared only after I reinstalled Windows :(

推荐答案

嗯,我的回答不仅仅是所有解决方案的总结,它提供的还不止这些.

第 (1) 节:

一般解决方案:

我有 4 个此类错误(找不到元数据文件"),还有 1 个错误提示无法打开源文件(‘未指定的错误’)".

I had 4 errors of this kind (‘metadata file could not be found’) along with 1 error saying 'Source File Could Not Be Opened (‘Unspecified error ‘)'.

我试图摆脱找不到元数据文件"错误.为此,我阅读了许多帖子、博客等,发现这些解决方案可能有效(在此处进行总结):

I tried to get rid of ‘metadata file could not be found’ error. For that, I read many posts, blogs etc and found these solutions may be effective (summarizing them over here):

  1. 重新启动 VS 并再次尝试构建.

  1. Restart VS and try building again.

转到解决方案浏览器".右键单击解决方案.转到属性.转到'配置管理器'.检查 'Build' 下的复选框是否被选中.如果其中任何一项或全部未选中,请检查它们并再次尝试构建.

Go to 'Solution Explorer'. Right click on Solution. Go to Properties. Go to 'Configuration Manager'. Check if the checkboxes under 'Build' are checked or not. If any or all of them are unchecked, then check them and try building again.

如果上述解决方案不起作用,请按照上面第 2 步中提到的顺序进行操作,即使所有复选框都已选中,请取消选中它们,再次选中并再次尝试构建.

If the above solution(s) do not work, then follow sequence mentioned in step 2 above, and even if all the checkboxes are checked, uncheck them, check again and try to build again.

构建顺序和项目依赖:

转到解决方案浏览器".右键单击解决方案.转到'项目依赖项...'.您将看到 2 个标签:'依赖项''构建顺序'.此构建顺序是构建解决方案的顺序.检查项目依赖项和构建顺序,以验证依赖于其他项目(比如project2")的某个项目(比如project1")是否在该项目(比如project2")之前尝试构建.这可能是导致错误的原因.

Go to 'Solution Explorer'. Right click on Solution. Go to 'Project Dependencies...'. You will see 2 tabs: 'Dependencies' and 'Build Order'. This build order is the one in which solution builds. Check the project dependencies and the build order to verify if some project (say 'project1') which is dependent on other (say 'project2') is trying to build before that one (project2). This might be the cause for the error.

检查丢失的 .dll 的路径:

检查丢失的 .dll 的路径.如果路径包含空格或任何其他无效的路径字符,请将其删除并再次尝试构建.

Check the path of the missing .dll. If the path contains space or any other invalid path character, remove it and try building again.

如果这是原因,则调整构建顺序.

If this is the cause, then adjust the build order.

第 (2) 节:

我的特殊情况:

我用各种排列组合尝试了上述所有步骤,并重新启动了 VS 几次.但是,它对我没有帮助.

I tried all the steps above with various permutations and combinations with restarting VS few times. But, it did not help me.

所以,我决定摆脱我遇到的其他错误('源文件无法打开('未指定的错误')').

So, I decided to get rid of other error I was coming across ('Source File Could Not Be Opened (‘Unspecified error ‘)').

我看到一个博客:http://www.anujvarma.com/tfs-errorsource-file-could-not-be-opened-unspecified-error/#comment-1539

我尝试了该博客中提到的步骤,并摆脱了错误'无法打开源文件('未指定的错误')',令人惊讶的是我摆脱了其他错误(找不到元数据文件")也是如此.

I tried the steps mentioned in that blog and I got rid of the error 'Source File Could Not Be Opened (‘Unspecified error ‘)' and surprisingly I got rid of other errors (‘metadata file could not be found’) as well.

第 (3) 节:

故事的寓意:

尝试上面第 (1) 节中提到的所有解决方案(以及任何其他解决方案)以消除错误.如果没有任何效果,根据上面第 (2) 节中提到的博客,从 .csproj 文件中删除源代码管理和文件系统中不再存在的所有源文件的条目.

Try all solutions as mentioned in section (1) above (and any other solutions) for getting rid of the error. If nothing works out, as per the blog mentioned in section (2) above, delete the entries of all source files which are no longer present in the source control and the file system from your .csproj file.

这篇关于错误“在 Visual Studio 中找不到元数据文件 '...Releaseproject.dll'"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆