语言

DtsContainer.DebugMode 属性

定义

获取或设置一个布尔值,指示对象是否 DtsContainer 处于调试模式,以及运行时是否应触发 OnBreakpointHit(IDTSBreakpointSite, BreakpointTarget) 事件。

public:
 property bool DebugMode { bool get(); void set(bool value); };
public bool DebugMode { get; set; }
member this.DebugMode : bool with get, set
Public Property DebugMode As Boolean

属性值

true表示对象处于调试模式,并触发事件 OnBreakpointHit(IDTSBreakpointSite, BreakpointTarget)

实现

示例

Package类通过继承EventsProvider实现 。DtsContainer 以下代码示例创建一个包,然后显示并设置继承自 DtsContainer的值。

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  

namespace Microsoft.SqlServer.SSIS.Samples  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            // The package is the ExecuteProcess package sample   
            // that is installed with the SSIS samples.  
            string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";  

            Application app = new Application();  
            Package p1 = app.LoadPackage(pkg, null);  

            // Show the properties inherited from DtsContainer.  
            Console.WriteLine("CreationName:    {0}", p1.CreationName);  
            Console.WriteLine("DebugMode:       {0}", p1.DebugMode);  
            Console.WriteLine("DelayValidation: {0}", p1.DelayValidation);  
            Console.WriteLine("Description:     {0}", p1.Description);  
            Console.WriteLine("Disable:         {0}", p1.Disable);  

            // Description is not set for this sample, so set it.  
            p1.Description = "This is the Execute Process Package Sample";  
            Console.WriteLine("Description after modification: {0}", p1.Description);  

            Console.WriteLine();  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace Microsoft.SqlServer.SSIS.Samples  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            ' The package is the ExecuteProcess package sample   
            ' that is installed with the SSIS samples.  
            Dim pkg As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx"   

            Dim app As Application =  New Application()   
            Dim p1 As Package =  app.LoadPackage(pkg,Nothing)   

            ' Show the properties inherited from DtsContainer.  
            Console.WriteLine("CreationName:    {0}", p1.CreationName)  
            Console.WriteLine("DebugMode:       {0}", p1.DebugMode)  
            Console.WriteLine("DelayValidation: {0}", p1.DelayValidation)  
            Console.WriteLine("Description:     {0}", p1.Description)  
            Console.WriteLine("Disable:         {0}", p1.Disable)  

            ' Description is not set for this sample, so set it.  
            p1.Description = "This is the Execute Process Package Sample"  
            Console.WriteLine("Description after modification: {0}", p1.Description)  

            Console.WriteLine()  
        End Sub  
    End Class  
End Namespace  

示例输出:

Creation名称:MSDTS。Package.1

调试模式:错误

延迟验证:正确

说明:

禁用:错误

修改后的描述:这是执行进程包示例

注解

每当任务遇到代码断点时,都会调用该 IsBreakpointTargetEnabled 函数。 由于 IsBreakpointTargetEnabled 反复调用函数查看断点目标是否启用成本较高,因此 DebugMode 该标志被覆盖,每个继承类都用来指示是否需要调试该可执行文件。 当该标志设置为 false时,任务可以避免检查启用断点的调用。 值 true 表示任务应检查启用断点,且为检查时 IsBreakpointTargetEnabled

适用于