Why would the custom SSIS log provider not show up

2019-05-17 08:12发布

问题:

I am trying to create a custom logging provider for SSIS, but when deploying the dll, it doesn't show up in the list of providers.

The SSIS version is 11.0.2100.60. I tried .NET Framework 2.0 and 3.5. I installed in the GAC, and also copied to both folders below:

C:\Program Files\Microsoft SQL Server\110\DTS\LogProviders
C:\Program Files (x86)\Microsoft SQL Server\110\DTS\LogProviders

After doing this, I opened Visual Studio [Shell], and created a simple SSIS package. When opening the SSIS\Logging... menu, the new custom log provider is not there.

The code that I am using now is the sample package provided by Microsoft (HTMLLogProviderCS) from Codeplex, and no luck.

Any ideas where I could have missed something?

回答1:

Here are the steps that I performed to create a custom log provider in .NET 4.0 framework using Visual Studio 2010. The steps also show how the provider was displayed in SQL Server Data Tools 2010.

To begin with, I am using the Microsoft SQL Server Integrations Services Designer version 11.0.2100.60

Create a class library project. I chose C# and .NET Framework 4, named the project as CS40.CustomLogProvider.

Change the class file name to say SSISCustomLogProvider. Right-click on References and navigate to the path C:\Program Files\Microsoft SQL Server\110\SDK\Assemblies to add the DLL Microsoft.SQLServer.ManagedDTS.dll

Paste the following code into the class:

using Microsoft.SqlServer.Dts.Runtime;

namespace CS40.CustomLogProvider
{
    [DtsLogProvider(
        DisplayName = "Custom log provider created by Siva",
        Description = "A simple log provider.",
        LogProviderType = "Custom")]
    public class SSISCustomLogProvider : LogProviderBase
    {
        // TODO: Override the base class methods.
    }
}

Double-click the Properties node under the project. Click Signing tab on the properties pages to sign the assembly with a strong key. Check Sign the assembly and select from Choose a strong name key file.

Enter a Key file name, say SampleKey. you can enter a password if you would like to.

Strong name key will be created and added to the project.

Build the project. I built the project in Release mode. The DLL will be available in C:\temp\CS40.CustomLogProvider\bin\Release. Now, it is time to register the DLL to GAC. I found the gacutil in the path C:\Program Files\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools

Open the command prompt in Run as administrator mode. Enter the following commands one by one and press enter.

Change the command prompt path to the location where gacutil can be found.

cd C:\Program Files\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools

Enter the following command to add the DLL to GAC.

gacutil -i C:\temp\CS40.CustomLogProvider\bin\Release\CS40.CustomLogProvider.dll

Copy the DLL CS40.CustomLogProvider.dll in location C:\temp\CS40.CustomLogProvider\bin\Release and paste it in C:\Program Files\Microsoft SQL Server\110\DTS\LogProviders. The value 110 in the path refers to SQL Server 2012.

Create a new SSIS package using SQL Server Data Tools.

On the newly created SSIS package, click SSIS --> Logging... to access the logging option

You will notice the newly created SSIS log provider. You can see that it shows the value used on the DisplayName attribute.

Hope that helps.