Error: System.IO.InvalidDataException: End of Central Directory record could not be found

How to solve the error "System.IO.InvalidDataException: End of Central Directory record could not be found. at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory"?

After upgrading to Studio version 19.4.4 and trying to create a new project or to upgrade the libraries of an existing one, the following error was received: "System.IO.InvalidDataException: End of Central Directory record could not be found. at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory() at System.IO.Compression.ZipArchive.Init"

One of the reasons might be that the installed packages are corrupt.

Possible approach:

  • Navigate to %USERPROFILE%\.nuget folder
  • Take a backup of the “packages” folder to a different location.
  • Delete the current folder in .nuget location.
  • Launch Studio again.