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 not updated in Visual Studio until user does a Save All or closes solution #4689

Closed
dougbu opened this issue Feb 25, 2017 · 4 comments
Labels
Resolution:External This issue appears to be External to nuget

Comments

@dougbu
Copy link

dougbu commented Feb 25, 2017

Please read the following information before posting the issue.

Before posting the issue...

  • If you're having trouble with the NuGet client tools (the Visual Studio extension, NuGet.exe command line tool, etc.), you are in the right place.

Details about Problem

NuGet product used: VS UI
Nuget Package Manager 4.0.0

dotnet.exe --version: 1.0.0-rc4-004883

VS version (if appropriate): 15.0.0+26222.1d15rel

OS version: Win10 v1607 (14393.696)

Worked before? Not positive but thing old package.config file was updated immediately.

Detailed repro steps so we can see the same problem

  1. Create a .NET Core Console solution
  2. Add a package e.g. Microsoft.EntityFrameworkCore.SqlServer v1.0.0
  3. Save everything
  4. Switch to a console window and confirm the .csproj file contains
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.0.0" />
  5. Open "Manage NuGet Packages…" again
  6. Update the package to a newer version e.g. v1.1.0 in above case
  7. Wait for restore to complete
  8. Switch to console window and…
    Expected
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.0" />
    Actual
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.0.0" />
  9. Save everything in Visual Studio
  10. Now Actual will match Expected.

Other suggested things

Verbose Logs

Please include verbose logs (NuGet.exe -verbosity detailed | dotnet.exe --verbose | etc...)

Sample Project

Very helpful if you can zip a project and paste into this issue!

@dougbu
Copy link
Author

dougbu commented Feb 25, 2017

Not positive but thing old package.config file was updated immediately.

I am sure no similar problem existed when editing project.json files in Visual Studio 2015.

Save everything in Visual Studio

At step 9, Visual Studio and the NuGet Package Manager show no indication anything at all needs to be saved.

@davkean
Copy link

davkean commented Feb 27, 2017

This issue was moved to dotnet/project-system#1628

@davkean
Copy link

davkean commented Feb 27, 2017

I've moved this issue over to the project-system - this is our experience/issue, this issue can be closed.

@emgarten
Copy link
Member

Thanks @davkean

NuGet doesn't force a save here for perf reasons. With packages.config it was a much smaller file that was only used by NuGet so saving it at the end of an operation instead of letting VS save it when closing the solution made more sense. Now that PackageReferences are in the project file and no longer written directly by NuGet I think it makes more sense for the project system to handle this so it can be optimized appropriately.

@emgarten emgarten added the Resolution:External This issue appears to be External to nuget label Feb 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution:External This issue appears to be External to nuget
Projects
None yet
Development

No branches or pull requests

3 participants