Discussion:
Only 1 .proj file - MSBuild says there are multiple ones
(too old to reply)
David Thielen
2006-11-21 17:36:01 UTC
Permalink
Hi;

When I run MSBuild from the command line it tells me "MSBUILD : error
MSB1011: Specify which project or solution file to use because this folder
contains more than one project or solution file."

I do have both a .proj (mine) and a .sln (VS 2005 generated) in the
directory. But the docs say that MSBuild will run the .proj file if it is the
only one in the directory. Are the docs wrong?
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
Linda Liu [MSFT]
2006-11-22 07:34:07 UTC
Permalink
Hi Dave,

When we run MSBuild from the command line, we usually specify a project or
solution file to build.

If we don't speicfy a project or solution file, MSBuild searches the
current working directory for a file name extension that ends in "sln" or
"proj".

If there's only one solution or project file in the folder. MSBuild uses
that file.

If there is no project file but more than one solution files, MSBuild tells
us the "error MSB1011", which you have mentioned in your message.

If there is no solution file but more than one project files, MSBuild tells
us the above error as well.

If there is a solution and a project file and the project file's solution
file is JUST that one resides in the folder, MSBuild uses the the solution
file, otherwise, it tells us the above error.

I have performed several tests on this and confirmed it.

It seems that the solution file in your folder is NOT the corresponding
solution file of the project file in the folder.

FYI, to check if a solution file is the corresponding solution file of a
project file or not, you may open the solution file with Visual Studio and
see whether the project file in the folder is opened in Visual Studio as
well. If yes, the solution file is the corresponding solution file of the
project file, otherwise, the solution file is not.

Please try my suggestion and let me know the result.
If you have anything unclear, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Loading...