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 类实现 DtsContainer 其继承的 EventsProvider. 下面的代码示例创建包,然后显示并设置继承自 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  

示例输出:

CreationName:MSDTS。Package.1

DebugMode: False

DelayValidation: True

说明:

禁用:False

修改后的说明:这是执行进程包示例

注解

每次任务在其代码中遇到断点时都会调用该 IsBreakpointTargetEnabled 函数。 由于调用函数 IsBreakpointTargetEnabled 以查看在重复调用断点目标时是否昂贵,因此 DebugMode ,每个继承类都会重写标志并使用该标志来指示是否要调试该可执行文件。 当此标志设置为 false时,任务可以避免调用以检查已启用的断点。 一个值 true 指示任务应检查已启用的断点,并在选中时 IsBreakpointTargetEnabled

适用于