Encountered a similar error in Visual Studio 2022 (instead of Visual Studio 2019). See the details below. I confirmed the fix by unchecking "Deploy VSIX content to experimental instance for debugging" in Solution Properties → VSIX.
The "GetDeploymentPathFromVsixManifest" task failed unexpectedly. System.AggregateException->Microsoft.Build.Framework.BuildException.GenericBuildTransferredException: One or more errors occurred. ---> Microsoft.Build.Framework.BuildException.GenericBuildTransferredException: Object reference not set to an instance of an object. --- End of inner exception stack trace ---