Doing a local NuGet package installation but getting the error - Unable to get repository signature information - nuget

I'm trying to do an offline NuGet package installation by following the answer by Samuel Jack here:
Text
1. Add the files to a folder called LocalPackages next to solution
2. Create a file called NuGet.config next to solution file
The .nupkg files are stored locally and installed using NuGet Package Manager but I'm getting this error - "Unable to get repository signature information for source https://api.nuget.org/v3-index/repository-signatures/5.0.0/index.json. Response status code does not indicate success: 403 (Forbidden)."
I don't understand why the package manager needs to get repository signature information from the internet when I'm trying to do an offline installation. Internet connection is blocked in my server & that's why I'm getting 403 error.
How do I install the NuGet packages locally without getting the error?

How do I install the NuGet packages locally without getting the error?
You can try the following steps:
Solution
1) please make sure that you have these xml nodes in the new Nuget.config file:
<disabledPackageSources>
<add key="xxxxx"(the source name of api.nuget.org/v3-index/repository-signatures/5.0.0/index.json) value="true" />
</disabledPackageSources>
2) clean all nuget caches or delete the packages folder under C:\Users\xxxx\.nuget\packages.
3) If you add the new Nuget.config file in your solution , it cannot work immediately, it needs a restart. You should restart VS and then open your project, and after that, it can work.

Related

vscode interactive notebooks nuget directory error

I was trying to include a nuget package in my C# cell, like the example below:
#r "nuget: PackageIWantToInclude"
when suddenly, I got a similar error like this:
Error: PackageManagement Error 3217 The source directory 'D:\MyLocalDirectory' not found
note that I have not made any edits on the settings pointing to any directory with the address 'D:\MyLocalDirectory'. I've also looked for a solution elsewhere without any success. Can anyone give me a hint on how to bring the source directory back into its default?
Turns out, vscode interactive notebook uses the nuget configuration included in Nuget.Config found in "C:\Users{computer name}\AppData\Roaming\NuGet".
In that current machine where the error occurs, I have some local package sources included that were already non-existent, though they were already disabled, as indicated when viewed using this command dotnet nuget list source.
What I did was to remove the non-existent package source from the Nuget.Config file--in this example that would be:
<add key="NonExistentSource" value="D:\MyLocalDirectory" />
and then I restarted the notebook kernel by:
opening Command Palette (CTRL+SHFT+P) or under View>>Command Palette..
and then selecting the restart notebook's kernel

Swift Package Dependency on local package using relative file path

Using Xcode File/Swift Packages/Add Package Dependency menu option I am able to add a local package by giving the url as file:///Users/saran/Desktop/Temp/NetworkUtility
Since it takes absolute path in my machine, would affect team development when a team member checkout my commit.
Is there a way I can mention the file url as relative path to the depending local package.
Having my consuming app in a folder sibling to NetworkUtility
I tried file://$(SRCROOT)/../NetworkUtility, but only getting popup "An unknown error occurred"
Not sure from which directory it is trying to resolve.
Any help is much appreciated.

NuGet Server cannot find .nupkg package files

Okay this is a derivative of Could not load file or assembly 'NuGet.Server, Version=2.11.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies seeing as though I couldn't find a solution to that.
I am publishing my Nuget Server project to my Windows 2012 R2 server and pointing to the applicable directory where the files live. The package files exist, as shown below in the screenshot however I keep on getting the below error:
Severity Code Description Project File Line Suppression State
Error Copying file Packages\PackageName.1.0.0.nupkg to obj\Release\Package\PackageTmp\Packages\PackageNameJson.1.0.0.nupkg failed. Could not find file 'Packages\PackageName.1.0.0.nupkg'. nuget_server_02 0
I have NuGet Server v2.11.3 installed and my project targets .NET Framework 4.6. One thing to note is that the packages themselves are from an earlier version of .NET - most likely 3.5.
This is my web.config file:
<add key="packagesPath" value="D:\RootFolder\SubFolder\SolutionNameFolder\ProjectNameFolder\Packages"/>
Even after several Restore NuGet Packages attempts I am still faced with this dilemma. The one thing I am really struggling to understand is if I point the packagesPath to a local directory, it works and does retrieve the packages however, when I point to the very same project on my server I get this headache.
Previously, in the included link to the related SO question, I could publish but now I can't even get through that stage even though I never made any changes to the project since last working on it. I decided to revisit it today.
UPDATE:
I have deleted the bin folder and rebuilt my solution as per Could not load file or assembly 'someProject' or one of its dependencies. Access is denied But it still can't find the file.
You can run your nuget server and it will show an html file as output (Default.aspx). You can, of course, modify this file to make it look like anything you want and otherwise change it. You can't change the way the nuget server service behaves because that is run from a dll. You should be able to show your repository files using the output page of your nuget server.
I encountered a similar set of errors, and monitored the Event Viewer while I was trying to show the contents of my repository.
The Event Viewer showed that an error was being thrown every time my Nuget Server attempted to list the contents of the packages folder.
Keeping in mind that nuget packages are zip files, and to display the details on the information contained in the nuget packages, the nuget server must unzip them. If the file is corrupted, the server will throw an error and stop attempting to list the contents of any further files. This error results in a w3wp.exe crash. It will be recorded as an ASP.NET error in the Windows->Applications section of the event log.
The cure for me was to delete the contents of the packages folder on my nuget server, and re-up them.
This may be impractical if you have a lot of files in your repository, so any files that were uploaded near the first error shown in the event viewer should be chosen for upload first.
One of the files is likely corrupted.
I would recommend checking out the event viewer on your server, and making sure you have no corrupted files in your repository.
You can view (and edit, to a point) your repository contents with Nuget Package Explorer. If the file you want to view is corrupted, then it should show an error for that file. You can then re-up that file, and if the problem is a file problem, this will cure it.
You can also reinstall your nuget server if that fails. It is somewhat unlikely that the code has been corrupted, but worth a shot.
Good luck.

Unable to upload package in AEM 6.2 - package file parameter missing

Everytime I upload a package on my QA server via Package Manager, it keeps loading it for a long time and then throws an error saying "package file parameter missing"
The error logs show absolutely no activity regarding the package.
This happens for both code packages (/apps/...) and content packages (/content/...)
Make sure your server has a tmp (linux) or temp (windows) folder accessible to the AEM process with full permission. This error occurs when the aem process cannot find the temp folder which it uses to temporarily store packages when they are being uploaded.

NuGet reference in wrong directory structure

My Web2 solution is failing to compile because some of the packages were hosted in a different directory structure to the rest of the solution, and I deleted this structure and the corresponding "packages" folder.
I used Update-Package -reinstall
Hoping that this would fix it... however it still kicks out this error message on build:
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\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props
Now as far as I can tell all the references should be OK, packages.config says:
<package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
And the directory structure exists
--Solution Dir
|-- packages
|--Microsoft.Net.Compilers.1.0.0
I tried updating the package and got version 1.3.2, but the error message remained the same, ie version 1.0.0 was missing.
Theres' clearly some reference to this floating around somewhere - but I don't know where to start looking. I'm assuming the ..\packages in the path indicates its looking for the package in the external directory location (as one up was where the original packages were)
Any ideas?
UPDATE:
I copied the packages folder back to its original location outside the solution directory and .... the issue isn't resolved. So maybe that was never the issue in the first place.
However the error message is still reporting a missing NuGet package that to all appearances is actually there.
This StackOverflow answer got me started on the right track, once I Googled the error message without the ..\ in front of the package location
https://stackoverflow.com/a/32296184/1286358
Then I had to go through and add serveral missing references - presumably because in my hacking attempts to fix the issue I had removed them then not re-referenced them.