How to Use nuget

1. Downloading packages to a build server
Motivation:

You have a .NET solution that uses NuGet package manager.

You have many files in the packages folder and want them to be downloaded to your build server.

Solution:
  • Download Windows x86 Commandline.
  • Copy nuget.exe to an folder and add the folder path to Windows PATH.
  • Open Command Prompt and execute the commands below.
    cd D:\Build\Source
    nuget restore YourSolutionFileName.sln
    
2. Downloading (Restoring) packages using MSBuild
  • Execute the commands below.
    "C:\Program Files\Microsoft Visual Studio\2022\Professional\Msbuild\Current\Bin\MSBuild.exe" "../YourSolution.sln" -restore -p:RestorePackagesConfig=true
    
3. Updating packages for a solution using VS Studio Package Manager Console
  • Open Tools > NuGet Package Manager >  Package Manager Console.
  • Execute the commands below.
    Update-Package
4. Reinstalling packages for a solution using VS Studio Package Manager Console
  • Open Tools > NuGet Package Manager >  Package Manager Console.
  • Execute the commands below.
    Update-Package –reinstall
    
5. Configuring package restore when building a project using VS Studio :
  • Open Tools > NuGet Package Manager >  Package Manager Settings.
6. Reverting PackageReference project to packages.config:
  • Copy and  overwrite project file from backup created by Visual Studio or from source control system.
  • Delete all obj and bin files.
7. Fixing “Could not load file or assembly…” issue:
  • Example issue:
    Could not load file or assembly 'Microsoft.IdentityModel.Tokens.Saml, Version=8.0.2.0
  • Open Visual Studio > Solution > Project > References > Microsoft.IdentityModel.Tokens.Saml > Properties and identify file or assembly version, e.g. 8.1.2.0.
  • Open Visual Studio > Solution > Project > web.config, search for Microsoft.IdentityModel.Tokens.Saml and modify the version for the file or assembly. Example:
    <bindingRedirect oldVersion="0.0.0.0-8.1.2.0" newVersion="8.1.2.0" />
  • Repeat the process for all the files or assemblies.

 

How to Disable Automatic Updates on Windows Server

Motivation:

You have a server with Windows Server 2016. The server Windows updates are being downloaded and installed automatically. This may affect your customers’ usage. You want to disable it so that you can install Windows updates when you find most appropriate.

Solution:
  1. Open Command Prompt (Admin).
  2. Type sconfig and press Enter.
  3. Press 5 (Windows Update Settings:), then press Enter.
  4. Press D (to select DownloadOnly option), then press Enter.
  5. Click OK button.
  6. Press 13 (Restart Server), then press Enter.
  7. Click Yes button to restart your server.

To disable automatic reboots in inactive hours, you can try the steps below.

1. Click Start and type Task Scheduler.
2. Expand Task Scheduler Library >> Microsoft >> Windows .
3. Click  UpdateOchestrator.
4. Right-click on Reboot and select Disable.

 

How to Fix EPUB Processing Failure on Google Play Books

Problem:

You uploaded EPUB file to Google Play Books but received Processing Failed error message.

Solution:
  1. Open https://www.zamzar.com.
  2. Click Choose Files and select EPUB file.
  3. Click Convert To and select azw3.
  4. Click Convert Now button.
  5. Download the azw3 file.
  6. Return to https://www.zamzar.com.
  7. Click Choose Files and select azw3 file.
  8. Click Convert To and select EPUB.
  9. Click Convert Now button.
  10. Download the EPUB file.
  11. Upload the EPUB file to Google Play Books.

Note: https://www.zamzar.com offers only 2 free daily conversions.