The package manager used by Sitecore's tools has changed from MyGet to NuGet. This article introduces the scope of the impact and the procedures to be followed.
From MyGet to NuGet
We have been using MyGet as our package manager, but this month it has been replaced by NuGet.
- Sitecore Install Framework
- Sitecore Docker Tools
- CLI Tools
- SDK Module and etc
If you use nuget in the future, you may not have to worry about it, but if you are already using it, you will need to switch it over.
Delete MyGet settings
First, delete the SitecoreRegistory when using MyGet.
Unregister-PSRepository -Name SitecoreGallery
Then uninstall the module.
Uninstall-Module -Name SitecoreDockerTools -AllVersions
XM Cloud Project Changes
In this case, we will change the settings listed for XM Cloud. If other SDKs have nuget.config files, you can use them by changing the Package Source as follows.
<packageSources>
<clear />
<add key="Nuget" value="https://api.nuget.org/v3/index.json" />
<add key="Sitecore" value="https://nuget.sitecore.com/resources/v3/index.json" />
</packageSources>
Also in init.ps1 there is code that reads myget. # Rewrite the part of the code in Check for Sitecore Gallery as follows
# Check for Sitecore Gallery
Import-Module PowerShellGet
$SitecoreGallery = Get-PSRepository | Where-Object { $_.SourceLocation -eq "https://nuget.sitecore.com/resources/v2/" }
if (-not $SitecoreGallery) {
Write-Host "Adding Sitecore PowerShell Gallery..." -ForegroundColor Green
Unregister-PSRepository -Name SitecoreGallery -ErrorAction SilentlyContinue
Register-PSRepository -Name SitecoreGallery -SourceLocation https://nuget.sitecore.com/resources/v2/ -InstallationPolicy Trusted
$SitecoreGallery = Get-PSRepository -Name SitecoreGallery
}
This change completes the part that works with the new nuget.
Summary
In some of the articles we have blogged so far, old projects use myget in some cases. Please change those parts to use the new URL of nuget as needed.