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

Corrupt NuGet.config is ignored by nuget #1567

Closed
yishaigalatzer opened this issue Oct 13, 2015 · 4 comments
Closed

Corrupt NuGet.config is ignored by nuget #1567

yishaigalatzer opened this issue Oct 13, 2015 · 4 comments
Assignees
Labels
Priority:2 Issues for the current backlog. Type:Bug
Milestone

Comments

@yishaigalatzer
Copy link

example:

Create a console app
install jquery
Clean the packages folder

Drop the following content into a local nuget.config

<boo

run nuget.exe restore consoleapp.sln

Expected

Fail or warn

Actual

The invalid config is ignored and restore proceeds

Why does it matter?
Imaging the config file was pointing to a different repository, but it had a flaw where the XML was invalid. The restore will bring down incorrect packages or fail with a warning that the packages don't exist.

@yishaigalatzer yishaigalatzer added this to the Client-VNext milestone Oct 14, 2015
@yishaigalatzer yishaigalatzer added Priority:2 Issues for the current backlog. Type:Bug labels Oct 14, 2015
@yishaigalatzer
Copy link
Author

Consider warning also for files without a configuration section. e.g.

<?xml version="1.0" encoding="utf-8"?>
<packageSources>
  <clear />
  <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  <add key="azure" value="https://www.myget.org/F/azureadwebstacknightly/" />
</packageSources>

@csharpfritz
Copy link
Contributor

Looks like a duplicate of #1302

Also reported on Twitter: https://twitter.com/devlead/status/684305178342731776

@yishaigalatzer
Copy link
Author

Summary: Any invalid config file that should be picked up, but fails to load should be turned into an error message that shows both in the UI and commandline (both nuget.exe and xplat). The error should be meaningful and point to the filename/file path and location in the file.

This should work both for the scenario where you pass in a -configFile or the config file is on disk, see #1302 for another repro scenario.

zhili1208 added a commit to NuGet/NuGet.Client that referenced this issue Feb 26, 2016
zhili1208 added a commit to NuGet/NuGet.Client that referenced this issue Mar 4, 2016
zhili1208 added a commit to NuGet/NuGet.Client that referenced this issue Mar 4, 2016
@zhili1208
Copy link
Contributor

it's fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:2 Issues for the current backlog. Type:Bug
Projects
None yet
Development

No branches or pull requests

3 participants