[英]Problem with building of the solution - Visual Studio 2022
Did anyone of You had the same problem as described below?你们中的任何人是否遇到过如下所述的相同问题? If so, do you have any tip or solution for this?
如果是这样,您对此有任何提示或解决方案吗?
I have a problem with my local environment.我的本地环境有问题。 Every time I try to build the solution, a lot of its projects are being skipped and I receive many CS0006 errors: "Metadata file (...) could not be found".
每次我尝试构建解决方案时,它的许多项目都被跳过,并且我收到许多 CS0006 错误:“找不到元数据文件 (...)”。
Another thing I noticed is ribbon with message "Current solution contains incorrect configurations mappings. It may cause projects to not work correctly. Open the Configuration Manager to fix them."我注意到的另一件事是带消息的功能区“当前解决方案包含不正确的配置映射。它可能导致项目无法正常工作。打开配置管理器以修复它们。” When I open Configuration Manager, all projects of solution are checked, and everything seems to be correct there.
当我打开 Configuration Manager 时,会检查所有解决方案项目,并且那里的一切似乎都是正确的。
I use Visual Studio 2022 (64-bit), version 17.4.1 and .NET Framework version 4.8.04084.我使用 Visual Studio 2022(64 位)版本 17.4.1 和 .NET 框架版本 4.8.04084。
I tried almost all recommendations from the Inte.net, including uninstalling and installing again Visual Studio or reuploading of repository, but there is no update about this problem.我尝试了几乎所有来自 Inte.net 的建议,包括卸载并重新安装 Visual Studio 或重新上传存储库,但没有关于此问题的更新。
Thank You in advance.先感谢您。
You could try the steps provided by Sabah Shariq.您可以尝试 Sabah Shariq 提供的步骤。
- Right click on the solution and click Properties.
右键单击该解决方案,然后单击“属性”。
- Click Configuration on the left.
单击左侧的配置。
- Make sure the check box under "Build" for the project is checked.
确保选中项目“构建”下的复选框。 If check then uncheck and check again and save the settings.
如果选中则取消选中并再次选中并保存设置。
- Clean the solution by right clicking on the project solution and rebuild the project again.
通过右键单击项目解决方案来清理解决方案并再次重建项目。
- Make sure you don't have any other error messages in your project and if you do, fix those first!
确保您的项目中没有任何其他错误消息,如果有,请先修复它们!
For more information, please refer to: Error CS0006_Metadata file could not be found更多信息请参考: Error CS0006_Metadata file could not be found
Thank you for your help.谢谢您的帮助。 I have found the cause of this problem by myself.
我自己找到了这个问题的原因。 It turned out that some lines of code was removed from sln file by mistake (in my opinion there was an error of Visual Studio).
原来sln文件中有几行代码被误删除了(我认为是Visual Studio的错误)。 When I re-added them, the solution is able to be built.
当我重新添加它们时,可以构建解决方案。 Anyway, thank you for your support.
无论如何,感谢您的支持。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.