public void Provision(ClientContext ctx, Web web, string manifestJsonFileAbsolutePath)
        {
            try
            {
                IsHostWeb = !WebHasAppinstanceId(web);
                Ctx       = ctx;
                Web       = web;

                var json = File.ReadAllText(manifestJsonFileAbsolutePath);

                //TODO: Deal with fallout from Version problem
                var manifest = AppManifestBase.GetManifestFromJson(json);
                manifest.BaseFilePath = !string.IsNullOrEmpty(manifest.BaseFilePath)
                    ? manifest.BaseFilePath
                    : Path.GetDirectoryName(manifestJsonFileAbsolutePath);

                try
                {
                    Provision(ctx, web, manifest);
                }
                catch (Exception ex)
                {
                    var newEx = new Exception("Error provisioning to web at " + Web.Url, ex);
                    throw newEx;
                }
            }
            catch (Exception ex)
            {
                var newEx = new Exception("Error provisioning to web at " + Web.Url, ex);
                throw newEx;
            }
        }
        public void Deprovision(ClientContext ctx, Web web, string manifestJsonFileAbsolutePath)
        {
            Ctx       = ctx;
            Web       = web;
            IsHostWeb = !WebHasAppinstanceId(Web);

            try
            {
                var json = File.ReadAllText(manifestJsonFileAbsolutePath);

                //TODO: Deal with fallout from Version problem
                var manifest = AppManifestBase.GetManifestFromJson(json);

                Deprovision(ctx, Web, manifest);
            }
            catch (Exception ex)
            {
                var newEx = new Exception("Error during deprovisioning", ex);
                throw newEx;
            }
        }