Adding Connection Manager to Script Component Cause Non-CLS Compliant Error
1. Added a script component, selected type "Source" On Connection Managers section, clicked "Add..." and selected a connection manager. Name defaults to "Connection" On Inputs and Outputs section, added a column to the default output (Output 0). Name defaults to "Column" On Script section, changed script type to Visual Basic Clicked "Edit Script..." and then exited script w/o adding/removing or changing auto-generated code At this point, the component fails build due to a warning in ComponentWrapper.vb (auto-generated code, can't be changed as it gets re-generated each time the component is saved). The warning reads "Return type of function 'Connection' is not CLS-compliant." The warning gets thrown on the class "Connections" public readonly property "Connection()" which gets auto-generated as: Public Readonly Property Connection() as IDTSConnectionManager100 Get Return ParentComponent.ComponentMetaData.RunTimeConnectionCollection.GetObjectByID(223).ConnectionManager End Get End Property Things I've tried: Different connection manager types (I've tried ADO.Net connection managers, OLDB connection managers and flat-file connection managers) Adding <CLSCompliant(False)> _ pragma to the Connection property (gets removed when the code is re-generated after saving component) Using C# code instead of VB. This seems to work, but I haven't converted all the other code from VB to C# yet so it's hard to tell if something else will fail later on in the chain of execution. I'm hesitant to do the conversion mostly because I'm stubborn and think it should work right w/o going to extreme workarounds. Any advice?
January 30th, 2011 12:43pm

Answered my own question, as usual. It appears that deleting the script component and creating it again, this time going directly to the connection managers section and selecting an ADO.NET manager (important!) prior to specifying the script langugage did the trick. I still get a warning, but the component doesn't fail during execution like it did before.
Free Windows Admin Tool Kit Click here and download it now
January 31st, 2011 1:23pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics