private void AddNuGetDependencyIfMissing(Project project, string packageId)
        {
            //Once the generated code has been added, we need to ensure that
            //the required ServiceStack.Interfaces package is installed.
            var installedPackages = PackageInstallerServices.GetInstalledPackages(project);

            //TODO check project references incase ServiceStack.Interfaces is referenced via local file.
            //VS has different ways to check different types of projects for refs, need to find method to check all.

            //Check if existing nuget reference exists
            if (installedPackages.FirstOrDefault(x => x.Id == packageId) == null)
            {
                PackageInstaller.InstallPackage("https://www.nuget.org/api/v2/",
                                                project,
                                                packageId,
                                                version: (string)null, //Latest version of packageId
                                                ignoreDependencies: false);
            }
        }