The repository primary signature validity period has expired - azure

I am getting this error in the Build and Deploy job phase of an Azure Static Web Apps CI/CD check-in. The first part of the error message is:
Run cd UnoPhotoViewer/UnoPhotoViewer.Wasm
Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
/home/runner/work/PhotoViewer/PhotoViewer/UnoPhotoViewer/UnoPhotoViewer.Wasm/UnoPhotoViewer.Wasm.csproj : error NU3028: Package 'runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.0' from source 'https://api.nuget.org/v3/index.json': The repository primary signature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain
/home/runner/work/PhotoViewer/PhotoViewer/UnoPhotoViewer/UnoPhotoViewer.Wasm/UnoPhotoViewer.Wasm.csproj : error NU3037: Package 'runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.0' from source 'https://api.nuget.org/v3/index.json': The repository primary signature validity period has expired.
It appears that all project nuget dependencies are throwing similar messages.
My Nuget Package Manager has both Allow Nuget to download missing packages AND Automatically check for missing packages during build in Visual Studio CHECKED.
Does anyone know what is causing this and how to resolve?
Thanks

Related

Visual Studio 2022 fails to load nuget packages from custom package repository

I'm using Visual Studio 2022 Update 17.3.3
I have some nuget packages in a custom store, maintained by my company. Accessing those packages used to work in the past. The way we set it up is generate a PAT on Azure ADO, and then use nuget to register them as package sources like this:
nuget.exe sources add -name mypackagerepo -password myPAT -username username#ourdomain.com -source https://pkgs.dev.azure.com/mycompany/_packaging/mypackagerepo/nuget/v3/index.json
A few days ago, Nuget Package Manager started to fail with the error
[mypackagerepo] Unable to load the service index for source https://mycompany.pkgs.visualstudio.com/_packaging/mypackagerepo/nuget/v3/index.json.
Response status code does not indicate success: 401 (Unauthorized).
If I open that link in a browser, I get HTTP 200 and a valid JSON response.
One series of steps to produce the error is
In VS / Tools / Nuget Package Manager / Manage Nuget Packages for Solution
In Package source, select the custom package source mypackagerepo
In the Browse tab, hit Refresh
VS displayes "Error occured"
Hit "Show errors in output"
The above error message is visible
I tried a bunch of things suggested by others
restarted VS
restarted my PC
removed my %appdata%/Roaming/Nuget/nuget.config file
created a new PAT and recreated the package source registrations
cleaned up (removed all VS related entries from) my credential cache
repaired then reinstalled VS
Any ideas how to fix it?

Azure DevOps build of Xamarin.iOS project fails - MTOUCH : error MT2002: Failed to resolve "System.Drawing.Color" reference

I have a build issue with a Xamarin.iOS app in Azure DevOps that I haven't been able to solve. I'm wondering if anyone has any suggestions.
Building the iOS version of the app works locally in VS for Mac but fails in Azure due to this error:
MTOUCH : error MT2002: Failed to resolve "System.Drawing.Color" reference from "System.Drawing.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [/Users/runner/runners/2.164.6/work/1/s/iOS/CatRentalStore.iOS.csproj]
I was having a similar issue with the Android build. I resolved it by switching from the macOS-10.14 hosted build agent to the windows-2019 agent, but that isn't an option with the iOS app.
I've updated packages that may use System.Drawing.Color to the latest stable releases - Acr.UserDialogs, BTProgressHUD, Splat, and Xamarin.Essentials.
I searched the solution source and did not find any direct references to the System.Drawing.Color class.
I also tried specifying the version of Xamarin/Mono to use in the build to match my local version using sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 6_4_0. That caused a different error to occur:
error MSB4018: The "GenerateDepsFile" task failed unexpectedly.
error MSB4018: System.MissingMethodException: Method not found: System.Collections.Generic.IList`1<NuGet.Packaging.Core.PackageDependency> NuGet.ProjectModel.LockFileTargetLibrary.get_Dependencies()
References to this issue:
https://github.com/mono/mono/issues/13483
https://github.com/xamarin/xamarin-macios/pull/6011
https://github.com/aritchie/userdialogs/issues/654
https://github.com/reactiveui/splat/issues/204
According to this document:
NET Core 2.2.105 is default on VM images but Mono version 6.0 or greater requires .NET Core 2.2.300+. If you use the Mono 6.0 or greater, you will have to override .NET Core version using .NET Core Tool Installer task. If you use 6.4.0, you need to install at least 2.2.300+ .net core.
I had the same problem. Visual Studio sometimes failed to update the reference during the NuGet package upgrade:
These steps helped me resolve my issue (iOS project):
Check every reference and see if it matches the version of the corresponding NuGet package
Check the path/version of the referenced assembly:
Make sure that it matches your installed package version:
If the versions do not match: downgrade the corresponding NuGet package and then upgrade the same NuGet package again and check if the version now matches
I did that procedure one NuGet package at a time. After ensuring that all versions match the build succeeded.
On my dev machine, the older versions were still present in the packages folder. Therefore the build always worked on my machine but not on the build server.

NuGet Package restore failed for project myProjectWeb: Unable to find version '3.0.1' of package 'AppForSharePoint16WebToolkit'

It's a provider hosted project. It used to work until very recently.
If I create a completely new project/solution, then it works.
If I start the old one, or redownload it from source control, I get the following error:
NuGet Package restore failed for project LocalTheaterWeb: Unable to find version '3.0.1' of package 'AppForSharePoint16WebToolkit'
I tried Update-Package -Reinstall but the problem stays.
Any ideas?
The solution of Scott Hillier did it for me:
http://www.shillier.com/archive/2014/08/05/nuget-package-restore-fails-for-sharepoint-2013-provider-hosted-apps.aspx
I often take advantage of the NuGet Package Restore capability to
reduce the size of my projects when saving or sharing them. Today, I
discovered an issue with this process when building SharePoint 2013
Provider-Hosted Apps against SharePoint Online. Here are the steps to
reproduce and the fix:
Create a Provider-Hosted App in Visual Studio 2013 using a SharePoint Online site for debugging.
Right click solution and "Enable NuGet Package Restore"
Save and Close Project
Delete the “packages” folder from project directory
Open Project in Visual Studio 2013
Rebuild, receive error “Unable to find AppForSharePoint16WebToolkit”
Open Packages.config file
Change “AppForSharePoint16WebToolkit” to “AppForSharePointWebToolkit”
Rebuild – successfully this time. Apparently, the "AppForSharePoint16WebToolkit" package is not available through the
NuGet Package Manager, but the older "AppForSharePointWebToolkit"
package is available.
The error message suggests that NuGet cannot find the AppForSharePoint16WebToolkit package in your package sources. So check the following:
The correct package source is selected whilst doing the Update-Package -Reinstall.
Check the package source that hosts the NuGet package is enabled. If you are using a recent version of NuGet the package restore should use all the enabled package sources.
See if the solution or project has its own NuGet.config which is overriding the package sources.
Without further information my guess is 3. since you say it works for a new project.
You can also run Fiddler to see what package sources NuGet is using as it tries to restore.
For older "locked down" projects with specific package version numbers that you can't update, un-check "Automatically check for missing packages during build in Visual Studio" which is found via:
Nuget Package Manager > Package Manager Settings
This means that if you toggle between newer projects and older projects you need to check and un-check this setting

VS 2012 missing prerequisite error

I am using visual studio 2012. I have already installed the Windows Azure SDK on my system. I am still getting the following error:
The system is missing a prerequisite to execute the service
.IISExpress Development certificate is not installed.
Can you check does your system met all the requirements of installing Azure SDK
If your system meets all the requirements, then try to install the missing components from Web Platform Installer of Azure

Adding NuGet ndef library to windows phone 8 project

So I tried to add the NDEF library for proximity application in Visual Studio 2012 for a Windows Phone 8 app. In Package Manager I checked Allow NuGet to download missing packages during build and in the Solution Explorer I selected Enable NuGet Package Restore.
So far so good, but when i try to install the package I get the following error:
Could not install package 'NdefLibrary 0.9.0.1'. You are trying to install this package into a project that targets 'WindowsPhone,Version=v8.0', but the package does not contain any assembly references that are compatible with that framework. For more information, contact the package author.
This works fine on my dev box. Here's the output from my NuGet package manager on a WP8 project:
PM> Install-Package NdefLibrary
You are downloading NdefLibrary from Andreas Jakl, the license agreement to which is available at https://ndef.codeplex.com/license. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'NdefLibrary 0.9.0.1'.
Successfully added 'NdefLibrary 0.9.0.1' to Wp8TestApp.
What you're probably missing is to update your NuGet package manager to the latest version. Go to Visual Studio File Menu --> Tools --> Extensions and Updates --> Updates --> Visual Studio Gallery --> NuGet --> Update and finally you'll need to restart. The reason why this update is needed is that the NuGet version that ships with VS2012 RTM doesn't support WP8 since WP8 didn't RTM before VS2012 did.

Resources