简体   繁体   English

构建解决方案的问题 - Visual Studio 2022

[英]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 提供的步骤。

  1. Right click on the solution and click Properties.右键单击该解决方案,然后单击“属性”。
  2. Click Configuration on the left.单击左侧的配置。
  3. Make sure the check box under "Build" for the project is checked.确保选中项目“构建”下的复选框。 If check then uncheck and check again and save the settings.如果选中则取消选中并再次选中并保存设置。
  4. Clean the solution by right clicking on the project solution and rebuild the project again.通过右键单击项目解决方案来清理解决方案并再次重建项目。
  5. 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.

相关问题 有没有办法在 entrie 解决方案上应用 Visual Studio 2022 中的 in.editorconfig 中的规则? - Is there a way to apply the rules in .editorconfig in Visual Studio 2022 on the entrie solution? Visual Studio 2013解决方案构建不在构建顺序中 - Visual Studio 2013 Solution building not in build order 解决方案资源管理器中缺少 Visual Studio 2022 查看代码按钮 - Visual Studio 2022 view code button missing on solution explorer Visual Studio 2022 中的代码清理仅适用于一个解决方案 - Code Cleanup in Visual Studio 2022 For One Solution Only Visual Studio 2015:错误构建解决方案 - Visual Studio 2015: error building solution Visual Studio:构建解决方案时输出时间戳 - Visual Studio: Output a timestamp when building solution Xamarin和Visual Studio 2015有关构建解决方案的问题 - Xamarin and Visual Studio 2015 issues with building a solution 为 MAUI Visual Studio 2022 安装 Android 工作负载时出现问题 - Problem installing Android workload for MAUI Visual Studio 2022 在 Visual Studio 2008 中发布解决方案时出现问题 - Problem in publishing a solution in Visual Studio 2008 安装 Visual Studio 2022 后,Visual Studio 2019 16.11.6 上的 Microsoft.CodeAnalysis 出现问题 - Problem with Microsoft.CodeAnalysis on Visual Studio 2019 16.11.6 AFTER install Visual Studio 2022
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM