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

csproj file is no longer updated after upgrading project's ToolsVersion #3837

Closed
peter-f-s opened this issue Apr 27, 2020 · 5 comments
Closed

Comments

@peter-f-s
Copy link

Description

when running paket install, the references in my project files (csproj) are updated according to the paket.references file. This worked fine as long as I was working with Visual Studio 2017 (the projects have set ToolsVersion="15.0").
After upgrading to Visual Studio 2019 (ToolsVersion="16.0"), paket ignores changes in the paket.references file. The references in the projects are staying the same when doing a paket install. However, paket touches the project file (it moves the import directive to Paket.Restore.targets to another location in the file).

Repro steps

paket.dependencies:

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

nuget StreamJsonRpc
nuget NUnit

paket.references:

StreamJsonRpc

csproj file beginning like this:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

Expected behavior

When I change the paket.references file (e.g. adding NUnit), I expect that a reference to NUnit is added to the project when I run paket install.
(This is actually the case when the csproj's ToolsVersion="15.0")

Actual behavior

The reference added to paket.references file is not added to the csproj file.
Removing references also doesn't work.

@forki
Copy link
Member

forki commented Apr 28, 2020

actuall we're always checking for if toolsVersion >= 15.0 then.

Can you please upload a zip where this reproduces? I want to fix it

@peter-f-s
Copy link
Author

Thank you! Here you go:
csprojUpdateIssue.zip
(I hope the zip is ok - I had to try several options and browsers until GitHub accepted the file)

@forki
Copy link
Member

forki commented Apr 29, 2020

this should be fixed

@forki forki closed this as completed in b89511f Apr 29, 2020
@forki
Copy link
Member

forki commented Apr 30, 2020

@peter-f-s does it work for you?

@peter-f-s
Copy link
Author

@forki: Yes, works perfectly! Many thanks for the quick reply. 👍

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

2 participants