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

VS's Package Management Console is broken #3231

Closed
M0ns1gn0r opened this issue May 30, 2018 · 8 comments
Closed

VS's Package Management Console is broken #3231

M0ns1gn0r opened this issue May 30, 2018 · 8 comments

Comments

@M0ns1gn0r
Copy link

Description

The changes introduced in commit 833b36c broke the Package Management Console in Visual Studio.

An error occurred while reading file 'D:\Work\PaketVersionTest\packages.config': Invalid package version for package id 'EntityFramework': '[6.2.0]'

The brackets syntax seems to be not supported by NuGet.

Repro steps

  1. Create paket.dependencies with the following content:
framework: net472
redirects: on

source https://api.nuget.org/v3/index.json

nuget EntityFramework ~> 6.2 version_in_path: true
  1. Create a classic .csproj and put EntityFramework to its paket.references.

  2. Execute paket install.

Expected behavior

  1. The created packages.config contains:
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="EntityFramework" version="6.2.0" />
</packages>
  1. The Package Management Console window can be opened, no errors are shown.

Actual behavior

  1. The created packages.config contains:
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="EntityFramework" version="[6.2.0]" />
</packages>
  1. An error is displayed after opening the Package Management Console window.
@forki
Copy link
Member

forki commented May 31, 2018

But the packages.config is correct. Isn't it?

@matthid
Copy link
Member

matthid commented May 31, 2018

I don’t think packages.config allows version ranges. packages.config always locks a particular version. I guess we have mixed parsing/serializing logic between multiple formats here?

@enricosada
Copy link
Collaborator

enricosada commented Jun 6, 2018

i can repro too at work.
after a paket install, the version is broken because [x.y.x] is not supported by vs.
i'll fix that

@0x53A
Copy link
Contributor

0x53A commented Jun 7, 2018

This also breaks unit test integration (e.g. xunit.runner.visualstudio)

@ben-reilly
Copy link

Do you folks have any updates on this? As far as I can tell and can verify locally, we just need to remove the square brackets from the version string in packages.config.

@forki
Copy link
Member

forki commented Jun 14, 2018 via email

inosik added a commit to inosik/Paket that referenced this issue Jun 14, 2018
@inosik
Copy link
Contributor

inosik commented Jun 14, 2018

See #3253.

@ben-reilly
Copy link

@inosik That looks right to me. Thanks for putting it together.

For others, here's the reference: https://docs.microsoft.com/en-us/nuget/reference/package-versioning

It appears that although it's possible to specify ranges in project and .nuspec files, and even in the "allowedVersions" attribute in packages.config, only exact versions are permitted in the "version" attribute in packages.config. So being able to read ranges is fine for those other files, but we should only be writing exact versions to packages.config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants