Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Get build errors if a solution is missing references#10780

Unanswered
AlexanderRydberg asked this question inQ&A
Discussion options

I need some advice. We have a monorepo with many .csproj files and solutions. Long story short, both scenarios involve the \bin\ and \obj\ folders being wiped from all projects.

If I build a solution with MSBuild, it builds fine:
msbuild.exe D:\Github\yyy\project\solution.sln /t:Restore;Build /m /p:Configuration=Release

However, when I build the same solution in Visual Studio 2022, I get the following error:
Severity: Error
Code: NU1105
Description: Unable to find project information for 'D:\GitHub\xxx\project\project.csproj'. If you are using Visual Studio, this may be because the project is unloaded or not part of the current solution, so try running a restore from the command line. Otherwise, the project file may be invalid or missing targets required for restore.

This error indicates that the .csproj file is missing from the solution, and someone needs to add the missing project. We would like to have a way to be alerted when a project is missing from a solution.

How would one go about making this happen?

My initial thought was to add some arguments to MSBuild that would cause it to fail if a solution is missing a reference, but I haven't been able to make MSBuild produce a build error in this case. Any help would be appreciated.

You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@AlexanderRydberg

[8]ページ先頭

©2009-2025 Movatter.jp