Elastacloud.AzureManagement.Fluent.Services.Classes.BuildActivity.Build C# (CSharp) Method

Build() public method

Build using the msbuild profile
public Build ( ) : void
return void
        public void Build()
        {
            if (UseExistingBuild)
                return;
            // TODO:We need to do the same for the ServiceConfiguration.cscfg drop this into another method
            _manager.CsdefFileInstance.PersistConfigurationFile(ConfigurationFileType.Current);
            _manager.CscfgFileInstance.PersistConfigurationFile(ConfigurationFileType.Current);
            // calls the start msbuild process
            Process msbuildProcess = null;
            try
            {
                msbuildProcess = StartMsBuildProcess();
            }
            catch (Exception e)
            {
                Trace.WriteLine("unable to complete MsBuild process returned with error: " + e.Message);
            }
            finally
            {
                // delete the old backup file and use this to replace the existing file .csdef file
                _manager.CsdefFileInstance.RollbackConfigurationFile();
                _manager.CscfgFileInstance.RollbackConfigurationFile();
            }

            if (msbuildProcess.ExitCode > 0)
            {
                throw new ApplicationException("build failed!");
            }
        }