Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added inner exception to error in case of MsBuild solution file parse failure #1150

Merged
merged 1 commit into from Mar 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/NuGet.Clients/NuGet.CommandLine/MsBuildUtility.cs
Expand Up @@ -330,11 +330,14 @@ public static IEnumerable<string> GetAllProjectFileNamesWithXBuild(string soluti
}
catch (Exception ex)
{
var exMessage = ex.Message;
if (ex.InnerException != null)
exMessage += " " + ex.InnerException.Message;
var message = string.Format(
CultureInfo.CurrentCulture,
LocalizedResourceManager.GetString("Error_SolutionFileParseError"),
solutionFile,
ex.Message);
exMessage);

throw new CommandLineException(message);
}
Expand Down
Expand Up @@ -1363,6 +1363,7 @@ public void RestoreCommand_InvalidSolutionFile()
Assert.NotEqual(0, r.Item1);
var error = r.Item3;
Assert.True(error.Contains("Error parsing solution file"));
Assert.True(error.Contains("Error parsing a project section"));
}
}

Expand Down