Can't restore nuget packages from local repository under VS2017 - nuget

I am moving from VS2015 to VS2017. I keep a local NuGet repository of stuff I'm working on that is used in other projects in a folder "D:\Development\ZNugetFeed".
I'm having to do a restore packages, and under VS2017 even though the file is there in the correct folder, and VS2017 is configured to use it as a repository, I keep getting an error "Unable to find version 'x.x.xxxx.xxxxx' of package 'y'." It then shows all the locations it says it didn't find it, including the folder it is in.
Has anyone seen this type of problem?

We solved the problem by installing IIS and the Nuget app, and then pointing VS2017 to the app.

Related

Github Visual Studio Pull : Will it include the Project's references?

Github Visual Studio 2022 Git Pull : Will it include the Project's references?
Using Visual Studio 2022 with Git. When pulling from a hosted repository into my local machine, will that also automatically set the same project references in my local machine as it is in the hosted repositories?
What should be the expected behaviour?
Thank you
I tried but I see other references than other users on other machines.
The project references should be defined in the .csproj file (or .vbproj, etc). This file should be included in ones source control repository.
You may need to perform a nuget restore if the references are fetched from a package manager (i.e. https://nuget.org), especially if someone else modified the references and pushed them to your remote in GitHub
For example, someone else on your project updates a reference to a newer version and pushes it up to GitHub. You then perform a git pull on the branch that these changes were made on, and suddenly you have new references or possibly see errors all over your code. When this happens, you almost certainly need to perform a nuget restore to get the new package references.

After adding submodule, nuget restores all packages to submodule packages directory in Azure Devops Build

Scenario: We wanted to move some code over to a new repo (NewSln), so we created that new repo, and then added the code back as a submodule in the original repo (OldSln). Had to modify a few references to point to the new version, but was able to get the build to work locally.
Issue: After doing this, the Azure Devops build failed on the msbuild building step due to
Error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105
The missing file is ..\..\..\packages\Fody.6.5.2\build\Fody.targets. and other similar issues. We had not made any changes to those references
I noticed that the restore step was restoring the packages to the submodule directory. For example, I saw this line
2022-02-10T23:52:45.1474898Z Adding package 'AcisExtensionSDK.1.0.4.1061' to folder 'C:__w\1\s\NewSln\packages'
I confirmed that this submodule is only used by the larger repo and not the submodule, yet it is being restored to \NewSln\packages\ rather than \packages\
Debugging effort so far: I can see the references that are showing up as missing on the build locally, and the build is working locally, with nothing obvious to me as why it fails on dev ops. I also see various stack overflow posts about the opposite issue, where the nuget restore doesn't import the references for the submodule repo, but I found nothing for the case where only the submodule repo is restored.
Is there anything that could cause this and what would be the way to route the packages being restored back to the appropriate package?

eclipse team explorer git jar files are not loaded

We have just moved from svn to git, hosted at Microsoft for Visual Studio.
I'm the only developer here using Java in eclipse. I installed the Team Explorer Everywhere plugin and am able to clone the repository. But the jar files inside the libraries are shells of their former selves, only the following meta-data:
version https://git-lfs.github.com/spec/v1
oid sha256:9d3agy7ae0a5be64b38f6e019a8ed6dca4bf60e4882178007qdf1c237dd78b4b
size 722914
I have heard that I need to set (or install) LFS (Large File Service), so I downloaded and installed git-lfs-windows-v2.5.2.exe. No change in the jar behavior.
If anyone out there knows how to tell Team Explorer Everywhere to turn on LFS, I would appreciate some guidance. Thanks.
OK Folks, I have unblocked myself by cloning the repository again and abandoning my previous clone. Apparently, either one of the installs I did changed the LFS behavior or the repository wasn't fully configured at the time I did the first clone. Takeaway: check your jars after cloning and before making code changes.

Odd NuGet cache issue; does NuGet keep track of package updates made?

I happened to get into a bit of a mess yesterday with our NuGet repository, and I've resolved it - but wanted to confirm my suspicions as to why it happened.
I did the following:
Amended some files
Packed the nuspec which includes these files
Pushed to our NuGet repository and confirmed
Confirmed that the NuGet repo had the latest version by downloading them on a dev environment
The changes I'd made were not included in the update in this dev environment (realised I hadn't updated the correct files). So I packed and pushed again without incrementing the version
Downloaded the nupkg on a different dev environment, still the changes were not there.
Took the exact same NuGet package and placed it in a local dir, and noticed when I updated from there it did include the changes.
Question
You'll notice as part of step 4 the old (incorrect) NuGet package was downloaded onto dev environment 1. Would NuGet have known this and, due to a lack of sound versioning, cached or kept hold of this copy somehow (despite my new push) and only allowed other dev environments this version and not the newest?
NOTE: I cleared the local cache on both dev environments prior to any updates made. My question was whether this was a server-side thing or not.
In addition to the copy of the package that is added to the packages folder in your solution NuGet will also cache packages already used in the following directory: C:\Users\YOUR_USER\.nuget\packages. Therefore if you do not change the version after making change you will have to remove the cached version from the directory I listed above for it to get the new changes since you did not change the package version.
I have the similar same problem. It's seem like a old issue.
So I will clear the http cache after I update the package version.
nuget locals http-cache -clear
It will work when you update your project package version.

Manage local nuget repository

I have a local nuget repository, where I would like to browse the packages, is there some kind of tool for this?
We have a project that is pushed to my local repository, when we have new updates we just push a new version. We needed to branch the project and therefor we pushed this new version. But I somehow didn't change the package id. So now I need to browse and remove this package, change the id and push it again?
So my questions is, is there any tool I can use to manage my local nuget packages?
I'm not aware of any 'tool' to accomplish this. However, you can manually remove the .nupkg file for the latest (bad) version from your packages folder.
Since you are running the repo from IIS, you can check your web.config file for the following key:
<add key="packagesPath" value="C:\folder\folderHoldingNupkgFiles" />
This will tell you where you .nupkg files are stored. Go there and find the latest version that you published and remove it. Afterward, change the id, etc, and republish as the new package.
Once this happens, you should see the original/previous version from before, as well as you new/branched version.