"Failed to create the task. ... Cannot create a task with the name "SSISExportToExcel.ExcelExport.ExcelExport, SSISExcelExport, ... Verify the name is correct"
Here's the beginning of my class... any help would be appreciated...
Namespace ExcelExport
<DtsTask(DisplayName:="Excel Export Task", _
Description:="Exports a SQL query results to an Excel Document")> _
Public Class ExcelExport
Inherits Task
....
It looks like either your namespace or your assembly name does not match what you have specified. The error message indicates that it is looking for "SSISExportToExcel.ExcelExport.ExcelExport" as the type name, and "SSISExcelExport" as the assembly name.|||ok, so how would I resolve this? I kind of copied an example when it came to the namespace, etc... so I'm not sure I have that right. How would I change the type name?|||by the way, I've removed the namespace, and made sure it's named correctly, and the two names are now "SSISExcelExport.ExcelExport, SSISExcelExport". It looks like the difference in names is caused by the "public class excelexport" in my assembly.
How do I change the assembly name or type name to get these to be equivalent?
|||I might get this wrong, as naming of assemblies and namespaces is not my strong suit. The type name is the namespace + the name of the public class you are referencing. So your namespace (and asembly) should be named SSISExcelExport, and your class should be named ExcelExport. I believe that it is case sensitive.|||Hmmmm... not sure that this is the problem. I now get the error
"Cannot create a task with the name "SSISExcelExport.ExcelExport, SSISExcelExport.ExcelExport, Version .... Verify that the name is correct."
|||
Something is wrong, because it should only be asking for the type in one part of the name.
Not sure what to tell you. I'd suspect that either the namespace or assembly is not being set properly, or the GAC still has an older version registered.
|||Any other ideas here?I believe I've uninstalled old versions through the gacutil ... using a batch file...
cd \
cd "Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin"
gacutil -u SSISExcelExport.ExcelExport
gacutil -if "C:\Program Files\Microsoft SQL Server\90\DTS\Tasks\SSISExcelExport.ExcelExport.dll"
and as for my namespace, not sure what to do.
|||
From the error message you mentioned above, it looks like there is still something not right in the namespace declaration.
Your assembly name is the same as your dll name, minus .dll. I'd suggest making sure that the namespace declaration in your component matches your assembly name, just for convenience. Then, when creating the task, it should reference the assembly name ("SSISExcelExport.ExcelExport") and type ("SSISExcelExport.ExcelExport.<name of your public class>").
|||Take a step back here, tasks do not care what namespace or assembly name you use. There is no reference to them in code, just in a package, or perhaps the designer. So for error #1 to have happened it says that this is an existing package and you have changed the string name of the task since it was built, or there is a mismatch between the cached task information in the designer and what is now installed in the GAC. Start a new package from scratch. It sounds like this is what you may have done in which case why does the designer think a task existing which it can not then create for you? Start by closing all instances of VS. Delete all copies of your task from \Program Files\SQL.. DTS\Tasks\ and also the GAC. Double check they are both clean. Open VS and Reset Toolbox, right click. Your task should now have gone from the toolbox. Make sure it has, if not why not? Close VS. Rebuild your task, add to Tasks folder and GAC, checking it is the same version, from the clean build. Then start again adding your task.
|||haven't forgotten about this... I'm going to be looking at it as soon as time permits. Thanks for the responses...
No comments:
Post a Comment