If you Register for COM interop it VS performs a RegAsm and a GACUTIL -i if
I am not mistaken, I only use this during demos, in real live I use regasm
and gacutil directly.
The COM catalog GUID CATID_DTSCustomTask should never be changed, it is
fixed.
The GUID your Custom Task should actually change but for the exercise of
getting it to work it should be OK.
The problem I guess you are having could be this:
You need to compile the RCW for DTSPkg.dll with the same key file as the one
you are using in you Custom Task.
Besides that, you will never be able to run REGSVR32 against the assembly or
use the DTS Register Custom Task in the DTS Designer.
That is why you need to add the registration functions:
<System.Runtime.InteropServices.ComRegisterFunction()> _
Public Shared Sub RegisterServer(ByVal t As Type)
and
<System.Runtime.InteropServices.ComUnregisterFunction()> _
Public Shared Sub UnregisterServer(ByVal t As Type)
When running RegAsm these functions should get called. Set a breakpoint in
the RegisterServer function and call RegAsm with the assembly name
implementing the Custom Task. That is why I have the Console.Writeline
statements in that function, so when you call it from the command prompt
when use RegAsm you see the output of the WriteLine.
Ge...@SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright ? SQLDev.Net 1991-2002 All rights reserved.
"James Radke" <jrad...@wi.rr.com> wrote in message
news:#RhtQNyMCHA.1640@tkmsftngp12...
> Gert,
> I will try that.. I don't believe I used any keys with the DTS package. I
> wasn't aware I needed that.
> I have another question, why do I have to make that DTSPkg.dll? Why can't
I
> just select the DTS com component in visual studio, and use that, versus
> having to build that separate DLL? Is that because of this key thing you
> are talking about?
> Jim
> "Gert E.R. Drapers" <Ge...@SQLDev.Net> wrote in message
> news:OigCJJuMCHA.2604@tkmsftngp11...
> > If you Register for COM interop it VS performs a RegAsm and a GACUTIL -i
> if
> > I am not mistaken, I only use this during demos, in real live I use
regasm
> > and gacutil directly.
> > The COM catalog GUID CATID_DTSCustomTask should never be changed, it is
> > fixed.
> > The GUID your Custom Task should actually change but for the exercise of
> > getting it to work it should be OK.
> > The problem I guess you are having could be this:
> > You need to compile the RCW for DTSPkg.dll with the same key file as the
> one
> > you are using in you Custom Task.
> > Besides that, you will never be able to run REGSVR32 against the
assembly
> or
> > use the DTS Register Custom Task in the DTS Designer.
> > That is why you need to add the registration functions:
> > <System.Runtime.InteropServices.ComRegisterFunction()> _
> > Public Shared Sub RegisterServer(ByVal t As Type)
> > and
> > <System.Runtime.InteropServices.ComUnregisterFunction()> _
> > Public Shared Sub UnregisterServer(ByVal t As Type)
> > When running RegAsm these functions should get called. Sey a breakpoint
in
> > the RegisterServer function and call RegAsm with the assembly name
> > implementing the Custom Task. That is why I have the Console.Writeline
> > statements in that function, so when you call it from the command prompt
> > when use RegAsm you see the output of the WriteLine.
> > Ge...@SQLDev.Net
> > "James Radke" <jrad...@wi.rr.com> wrote in message
> > news:#5GgTOlMCHA.1740@tkmsftngp08...
> > > Gert,
> > > I think I am just missing one step, and I don't know what?
> > > I thoroughly went through the ExecSQLTaskVB example, and found to
> settings
> > > that I did not have on in my project. The first was the Root
Namespace
> > > being set to 'DTS' in the general assemblies option of the project
> > > properties, and the second was the Register for Com Interop checkbox
in
> > the
> > > Configuration - Build section of the project properties.
> > > Once I have checked the Register for Com Interop, it produces the .TLB
> > file
> > > automatically, so I shouldn't need to run REGASM correct?
> > > Also, I noticed the hard-coded GUID in the RegisterServer function of
> your
> > > application as follows:
> > > CATID_DTSCustomTask = "{10020200-EB1C-11CF-AE6E-00AA004A34D5}"
> > > Do I need to modify this GUID, or leave it as it is? So far, I have
> left
> > it
> > > as it is...
> > > I also created a key via the sn.exe utilitiy and included the command:
> > > <Assembly: AssemblyKeyFileAttribute("DBMaintTask.snk")>
> > > in the AssemblyInfo.vb to create the assembly with a strong name.
> > > So, now the process I use is to re-build the solution, then run
> > 'gacutil.exe
> > > /i DBMaintTaskVB.dll' to put it into the global cache.
> > > And, it still get's the error 'could not find entry point for
> > > DLLRegisterServer in the DLL' when I attempt to register the
> application
> > > into DTS. I am attempting to register the .DLL file fom the BIN
> > directory.
> > > I have also tried registering the .TLB file, and then it tells me that
> it
> > is
> > > not a windows application.
> > > Am I correct so far? Did I not have to do any of the steps I
mentioned?
> > > What am I missing?
> > > Thanks for all your help!
> > > Jim
> > > ps, after I compile the sample you gave, I also get the same error
when
> > > attempting to register it to DTS; But I did not run the gacutil on it
or
> > > anything.
> > > "Gert E.R. Drapers" <Ge...@SQLDev.Net> wrote in message
> > > news:ew3K3hbMCHA.2340@tkmsftngp08...
> > > > That means you skipped the step that create the strong key file,
using
> > > > SN.EXE (see slide) and see the assembly.cs file of the samples on
how
> it
> > > is
> > > > used.
> > > > You need to compile you assembly with a string key pair in order to
be
> > > able
> > > > to register an assembly in the GAC, this is true for all assemblies
> that
> > > you
> > > > install in the GAC not just a DTS Custom Task.
> > > > Ge...@SQLDev.Net
> > > > Please reply only to the newsgroups.
> > > > This posting is provided "AS IS" with no warranties, and confers no
> > > rights.
> > > > You assume all risk for your use.
> > > > Copyright ? SQLDev.Net 1991-2002 All rights reserved.
> > > > "James Radke" <jrad...@wi.rr.com> wrote in message
> > > > news:OcLg6dbMCHA.2532@tkmsftngp13...
> > > > > Gert,
> > > > > I read through all the topics, and modified my code to have the
two
> > new
> > > > > functions Register and Unregister... and I ran the build.cmd which
> > > > generated
> > > > > the dll which I changed my references to, but I am still missing
> > > > something!
> > > > > Here is what I have done so far...
> > > > > 1.) Ran the build.cmd to create the
Microsoft.sqlserver.DTSPkg80.dll
> > > > > 2.) Set a reference to that in the application
> > > > > 3.) added an import Microsoft.SqlServer.DTSPkg80 at the top of my
> > module
> > > > > 4.) changed all references from DTS, etc to the above mentioned
> > > > > Microsoft.SqlServer.DTSPkg80 throughout the application
> > > > > 5.) added in the register and unregister subroutines as shown in
> your
> > vb
> > > > > example
> > > > > 6/) ran REGASM to register the new dll....
> > > > > I tried to perform a GACUtil, but I received an error saying I did
> not
> > > > have
> > > > > a strong type name, whatever that means.
> > > > > Yet, when I try and register it, I get the same error as before!
> > > > > What else would I need to do?
> > > > > Also, In the register function, I saw a hard coded UIC.. what is
> that
> > > > from?
> > > > > Do I have to modify that?
> > > > > Thanks!
> > > > > Jim
> > > > > "Gert E.R. Drapers" <Ge...@SQLDev.Net> wrote in message
> > > > > news:u3sMKXaMCHA.2932@tkmsftngp13...
> > > > > > You can get more details from a presentation that I gave about
> this
> > > > > subject,
> > > > > > presentation and samples are available on
> http://sqldev.net/download/conf/TechEd2002-Barcelona/dat372-ppt.zip
> http://sqldev.net/download/conf/TechEd2002-Barcelona/dat372-demo.zip
> > > > > > Ge...@SQLDev.Net
> > > > > > Please reply only to the newsgroups.
> > > > > > This posting is provided "AS IS" with no warranties, and confers
> no
> > > > > rights.
> > > > > > You assume all risk for your use.
> > > > > > Copyright ? SQLDev.Net 1991-2002 All rights reserved.
> > > > > > "Jim Radke" <j...@stratecon.net> wrote in message
> > > > > > news:1b88e01c2317f$b2bbe0a0$3bef2ecf@TKMSFTNGXA10...
> > > > > > > Hello,
> > > > > > > I have seen several posts on here regarding DTS Custom
> > > > > > > Tasks created in vb.net. Unfortunately, they are no
> > > > > > > longer available on the server for me to read!
> > > > > > > So, I will have to ask several questions which have
> > > > > > > probably been asked before:
> > > > > > > 1.) Can you create a DTS custom task in VB.NET? I took
> > > > > > > one that I had created in VB6.0, which is working fine,
> > > > > > > and ported it over to VB.NET. After making the necessary
> > > > > > > changes, the compile went smooth. However, I get an error
> > > > > > > when I try to register my vb.NET dll in the package
> > > > > > > designer (register function from the Tasks menu). It says
> > > > > > > something like Entry Point not found? Are there
> > > > > > > directions somewhere on how to do this?
> > > > > > > 2.) If I do create a custom task in vb.net, would this
> > > > > > > mean that I can truly parallel process tasks along with
> > > > > > > the new custom task (I believe VB6 always used the main
> > > > > > > DTS thread, and kept anything else from executing
...
read more »