Microsoft.WindowsAzure.Commands.Utilities.CloudService.CloudServiceProject.CreatePackage C# (CSharp) Method

CreatePackage() private method

private CreatePackage ( DevEnv type ) : void
type DevEnv
return void
        public void CreatePackage(DevEnv type)
        {
            string standardOutput, standardError;
            VerifyCloudServiceProjectComponents();
            CsPack packageTool = new CsPack();
            packageTool.CreatePackage(Components.Definition, Paths, type, AzureTool.GetAzureSdkBinDirectory(), out standardOutput, out standardError);
            if (!string.IsNullOrWhiteSpace(standardError))
            {
                //The error of invalid xpath expression about endpoint in the configuration file is expected. Hence, we do not throw.
                if (!standardError.Contains("/RoleEnvironment/CurrentInstance/Endpoints/Endpoint[@name='HttpIn']/@port"))
                {
                    throw new InvalidOperationException(string.Format(Properties.Resources.FailedToCreatePackage, standardError));
                }
            }
        }

Usage Example

Esempio n. 1
0
        public void CreateLocalPackageWithNodeWorkerRoleTest()
        {
            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                CloudServiceProject service = new CloudServiceProject(files.RootPath, serviceName, null);
                service.AddWorkerRole(Test.Utilities.Common.Data.NodeWorkerRoleScaffoldingPath);
                service.CreatePackage(DevEnv.Local);

                AzureAssert.ScaffoldingExists(Path.Combine(service.Paths.LocalPackage, @"roles\WorkerRole1\approot"), Path.Combine(Resources.NodeScaffolding, Resources.WorkerRole));
            }
        }
All Usage Examples Of Microsoft.WindowsAzure.Commands.Utilities.CloudService.CloudServiceProject::CreatePackage