简体   繁体   中英

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".

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.

I use Visual Studio 2022 (64-bit), version 17.4.1 and .NET Framework version 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.

Thank You in advance.

You could try the steps provided by 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

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). When I re-added them, the solution is able to be built. Anyway, thank you for your support.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM