I have written this code to implement an SSIS control flow task that fetches a file over HTTP:
using System;
using Microsoft.SqlServer.Dts.Runtime;
namespace HttpTask
{
[DtsTask(
DisplayName = "HTTP Task",
TaskContact = "Iain Elder",
RequiredProductLevel = DTSProductLevel.None
)]
public class HttpTask : Task
{
public string LocalPath {get; set;}
public string Connection {get; set;}
public bool OverwriteDestination {get; set;}
public DTSExecResult Execute(Connections connections,
VariableDispenser dispenser, IDTSComponentEvents events,
IDTSLogging log, object transaction)
{
HttpClientConnection http = AcquireHttpConnection(connections);
http.DownloadFile(this.LocalPath, this.OverwriteDestination);
return DTSExecResult.Success;
}
private HttpClientConnection AcquireHttpConnection(Connections connections)
{
ConnectionManager cm = connections[this.Connection];
object nativeConnection = cm.AcquireConnection(null);
return new HttpClientConnection(nativeConnection);
}
}
}
In Visual Studio I build and deploy my task using this post-build script to copy the package to the global assembly cache:
"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\gacutil.exe" /if "$(TargetPath)"
copy $(TargetFileName) "C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Tasks"
I can see the task in my toolbox when using Business Intelligence Development Studio:
When I drag the task to the design window, I see this error:
The task does not appear on the design canvas.
What have I done wrong here?
EDIT: Siva suggested that I should sign the assembly with a strong name. I followed steps 1 and 2 of the guide to signing assemblies on Benny Austin's blog. I didn't follow the other steps because my post-build script deploys the component for me.
In the Visual Studio project properties, I go to the Signing tab and create a new strong name key file for the assembly:
I save the settings and rebuild the package. The post-build script deploys the new package.
I still get exactly the same error.