none
nuget is completely wonky RRS feed

  • Question

  • Microsoft Visual Studio Professional 2015
    Version 14.0.25431.01 Update 3
    Microsoft .NET Framework
    Version 4.7.02556

    Installed Version: Professional

    I have an MVC Project. nuget is so very confused about the version of everything I have installed.

    For instance, if I open nuget package manager from the Project, I see this for Microsoft.Owin

    NOTE that Installed does not match Version.  If I look in Packages.config, I see 4.0.0.

    Now, if I open nuget manager from the Solution, I see this...

    Now it looks like we have 4.0.0 everywhere.  Where is the disconnect?  When I look in the packages folder, I see Microsoft.Owin.4.0.0

    So, where is this version 3.1.0 coming from and how do I send it to oblivion?

    ---

    The issue I am seeing is that I check in a working project to TFS, and my coworker can't even build it. furthermore, these references are not updated on a Get Latest.  It's making work sharing impossible.


    I'd rather live with false hope than with false despair.

    • Moved by Fei Hu Tuesday, March 6, 2018 8:28 AM Moved from C#
    Friday, February 23, 2018 11:32 PM

All replies

  • You have the right version on your machine, right? With that being said, you should just leave well enough alone and move on.
    Friday, February 23, 2018 11:57 PM
  • You have the right version on your machine, right? With that being said, you should just leave well enough alone and move on.

    Except as I said, it works fine for me, but when the other developer opens the project there are numerous (>60) compile errors, INCLUDING, the compiler saying that microsoft.owin is missing.  Which it is not.

    I'd rather live with false hope than with false despair.

    Saturday, February 24, 2018 12:16 AM
  • You have the right version on your machine, right? With that being said, you should just leave well enough alone and move on.


    Except as I said, it works fine for me, but when the other developer opens the project there are numerous (>60) compile errors, INCLUDING, the compiler saying that microsoft.owin is missing.  Which it is not.

    I'd rather live with false hope than with false despair.

    I would say have your coworker wipe out the workspace on the harddrive  and do a Getlastes recursive, trying to bring his or her workspace into sync with the base solution that's in the repository.

    Saturday, February 24, 2018 12:41 AM
  • Among other things, we have a problem where tfs is archiving the /bin and the /packages folders

    I'd rather live with false hope than with false despair.

    Tuesday, February 27, 2018 8:41 PM
  • I think you misunderstand what the Package Manager UI is showing you. In the project view you are seeing the version that your project is using (Installed) is 4.0.0. The Version combo is going to list the other versions that are available. At this point you could select a different version and then "Update" to downgrade to an older version (or upgrade to a newer one if there was one). You should be able to click on the Version dropdown and select the installed version. At that point the option to Update will get disabled because you're already there.

    In the solution view of PM you see the same info when on the Installed page. The Installed field isn't that meaningful but each project will list the version of the package it is using. You can use the Version field to then update/downgrade a package for one or more projects (or all of them). 

    If you have multiple projects referencing the same package but different versions then not only would you see that under the Installed tab but you'd also have a count on the Consolidate tab where it would show you the mismatches.

    Your TFS issues sound like a separate issue. You didn't mention whether you were using NuGet automatic restore or not. If this is a new project then you are. In that case the package(s) will be auto-downloaded when the solution loads (or at build or when going into the PM dialog).

    You also mentioned that you are having an issue with TFS archiving the bin and packages folder. That will actually cause you a lot of problems. The PM dialog looks at the Packages folder to help it determine what packages are in use. This folder structure should be completely managed by VS and never checked into TFS. You should delete that entire folder along with any bin and obj folders. TFS will not include bin and obj folders by default but Packages folder it doesn't know anything about. When you add/update a package then NuGet will add it to the project which TFS will see as a file add and attempt to add it to the solution. You don't want to do this. Unfortunately NuGet doesn't support doing this directly so instead you need to create a .nuget folder in the root of your solution and then drop in a nuget.config that tells it not to try to check files into source control. This will prevent it from trying to add the packages to source control. That process is documented here.

    Once you've made the above changes then you shouldn't get packages checked in anymore. Wipe the bin, obj and packages folder for your solution. Reload VS and see if your problems go away, including with the odd behavior of the PM dialog.


    Michael Taylor http://www.michaeltaylorp3.net

    Tuesday, February 27, 2018 9:02 PM
  • Among other things, we have a problem where tfs is archiving the /bin and the /packages folders

    I'd rather live with false hope than with false despair.

    I use TFS Express at home, and there is no way the Bin and Package folders in a solution were placed into the repository by TFS doing it automatically.

    Someone had to check-in the Bin and Package folders without knowing what he or she was doing. 

    I would say delete the Bin and Package folders that are in the TFS repository for the solution out of the TFS repository do a Clean and Rebuild on the solution.

    Tuesday, February 27, 2018 9:21 PM