dbTalk Databases Forums  

Create Assembly for Referencing in ScriptComponent

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Create Assembly for Referencing in ScriptComponent in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mirek Endys
 
Posts: n/a

Default Create Assembly for Referencing in ScriptComponent - 09-22-2008 , 05:14 AM






What specific things have to do, that I will be able referencing my own
assembly in the script editor in DataFlow ScriptComponent.

I Strongly signed my asembly, install that into the GAC, but I cannot see it
in the list of asseblies in the ScriptComponent references. There is nio
possibility to browse for that assembly.

Thanks for answer

Mirek

Reply With Quote
  #2  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Create Assembly for Referencing in ScriptComponent - 09-22-2008 , 10:38 PM






Hi Mirek,
Thank you for using Microsoft MSDN Managed Newsgroup. My name is Charles and I am glad to work with you on this issue.

From your description, I understand that you would like to know how to add your custom assembly in the script editor in dataflow scriptcomponent.
If I have misunderstood, please feel free to let me know.

This is a common seen question and I recommend that you refer to Wei Lu's answer in this old thread:
http://www.microsoft.com/communities...1b5&cat=en-us-
msdn&lang=en&cr=US&sloc=en-us&m=1&p=1

Anyway for your reading convenience, I would like to extract the main part of his answer here:
-----------------------------------------------------------------------------------------------------------------------------
The Add Reference dialog box in VSA does not include the Browse button that is present in Microsoft Visual Studio for locating and referencing other
managed assemblies, and does not include the COM tab for referencing COM components.
Furthermore, you cannot cause assemblies from other locations to be displayed in this list in VSA by adding other folder names under the AssemblyFolders
registry key, as described in the Microsoft Knowledge Base for use with Visual Studio. For more information, see see How to display an assembly in the Add Reference dialog box.

Here are some step by step guidance to add your custom assembly to the Script Task
============
* Make a new Visual Studio 2005 project such as VB class library, or C# class library. Write the bulk of your code in your favorite language.
One your are done with your coding, take the next steps before compiling the final version.

============
* Get a public/private key so your assembly can be compiled into having a strong name using the utility sn.exe.

Match the name to your assemblies name such as myapp. C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe -k myapp.key

============
* Put the Key into your Visual Studio project folder for your app:
C:\Documents and Settings\jasonh\My Documents\Visual Studio 2005\Projects\MyApp\myapp.key

============
* Add the moved key location to your project's automatically generated assembly info for the next compilation. Relative folder location is fine... you
might have to add ..\..\myapp.key depending on where you put your key.

In your solution explorer, check the option to show all files. For VB: Open AssemblyInfo.vb
Add the line <Assembly: AssemblyKeyFile("myapp.key")>

For C#: Open AssemblyInfo
Add the line [assembly:AssemblyKeyFile("myapp.key")]

Now recompile the project, and the assembly should be be signed with the key you provided.

============
* Put your signed file into a common folder that VSA checks for references.
Note that VSA doesn't allow many locations by default and there is not a Browse button.


Put your file in one of these two places:
"C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.<whatever >\"

* Now install your assembly into the Global Assembly Cache using gacutil:
gacutil /i "C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\myapp.dll"

============
* Open your SSIS Package and edit your script task.
- Design the script.
- On the Project Explorer pane, right click on References to [add a reference].
- Your assembly should show up in the list now of references you can add in alphabetical order. Click the Add button.
- Put the imports word into your script code... "Imports MyApp"
- Now instantiate your new assembly into an object in your script code and use the methods you have written against your new object.

Public Sub Main()
Dim instance As MyApp = New MyApp
Dim answer As Integer = instance.somemethod("parm1", "param2")
MsgBox(answer)
End Sub

============
--------------------------------------------------------------------------------------------------------------------------
Abbreviation:
VSA: Visual Studio for Applications environment


Hope this helps. If you have any other questions or concerns, please feel free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #3  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Create Assembly for Referencing in ScriptComponent - 09-22-2008 , 10:38 PM



Hi Mirek,
Thank you for using Microsoft MSDN Managed Newsgroup. My name is Charles and I am glad to work with you on this issue.

From your description, I understand that you would like to know how to add your custom assembly in the script editor in dataflow scriptcomponent.
If I have misunderstood, please feel free to let me know.

This is a common seen question and I recommend that you refer to Wei Lu's answer in this old thread:
http://www.microsoft.com/communities...1b5&cat=en-us-
msdn&lang=en&cr=US&sloc=en-us&m=1&p=1

Anyway for your reading convenience, I would like to extract the main part of his answer here:
-----------------------------------------------------------------------------------------------------------------------------
The Add Reference dialog box in VSA does not include the Browse button that is present in Microsoft Visual Studio for locating and referencing other
managed assemblies, and does not include the COM tab for referencing COM components.
Furthermore, you cannot cause assemblies from other locations to be displayed in this list in VSA by adding other folder names under the AssemblyFolders
registry key, as described in the Microsoft Knowledge Base for use with Visual Studio. For more information, see see How to display an assembly in the Add Reference dialog box.

Here are some step by step guidance to add your custom assembly to the Script Task
============
* Make a new Visual Studio 2005 project such as VB class library, or C# class library. Write the bulk of your code in your favorite language.
One your are done with your coding, take the next steps before compiling the final version.

============
* Get a public/private key so your assembly can be compiled into having a strong name using the utility sn.exe.

Match the name to your assemblies name such as myapp. C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe -k myapp.key

============
* Put the Key into your Visual Studio project folder for your app:
C:\Documents and Settings\jasonh\My Documents\Visual Studio 2005\Projects\MyApp\myapp.key

============
* Add the moved key location to your project's automatically generated assembly info for the next compilation. Relative folder location is fine... you
might have to add ..\..\myapp.key depending on where you put your key.

In your solution explorer, check the option to show all files. For VB: Open AssemblyInfo.vb
Add the line <Assembly: AssemblyKeyFile("myapp.key")>

For C#: Open AssemblyInfo
Add the line [assembly:AssemblyKeyFile("myapp.key")]

Now recompile the project, and the assembly should be be signed with the key you provided.

============
* Put your signed file into a common folder that VSA checks for references.
Note that VSA doesn't allow many locations by default and there is not a Browse button.


Put your file in one of these two places:
"C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.<whatever >\"

* Now install your assembly into the Global Assembly Cache using gacutil:
gacutil /i "C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\myapp.dll"

============
* Open your SSIS Package and edit your script task.
- Design the script.
- On the Project Explorer pane, right click on References to [add a reference].
- Your assembly should show up in the list now of references you can add in alphabetical order. Click the Add button.
- Put the imports word into your script code... "Imports MyApp"
- Now instantiate your new assembly into an object in your script code and use the methods you have written against your new object.

Public Sub Main()
Dim instance As MyApp = New MyApp
Dim answer As Integer = instance.somemethod("parm1", "param2")
MsgBox(answer)
End Sub

============
--------------------------------------------------------------------------------------------------------------------------
Abbreviation:
VSA: Visual Studio for Applications environment


Hope this helps. If you have any other questions or concerns, please feel free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #4  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Create Assembly for Referencing in ScriptComponent - 09-22-2008 , 10:38 PM



Hi Mirek,
Thank you for using Microsoft MSDN Managed Newsgroup. My name is Charles and I am glad to work with you on this issue.

From your description, I understand that you would like to know how to add your custom assembly in the script editor in dataflow scriptcomponent.
If I have misunderstood, please feel free to let me know.

This is a common seen question and I recommend that you refer to Wei Lu's answer in this old thread:
http://www.microsoft.com/communities...1b5&cat=en-us-
msdn&lang=en&cr=US&sloc=en-us&m=1&p=1

Anyway for your reading convenience, I would like to extract the main part of his answer here:
-----------------------------------------------------------------------------------------------------------------------------
The Add Reference dialog box in VSA does not include the Browse button that is present in Microsoft Visual Studio for locating and referencing other
managed assemblies, and does not include the COM tab for referencing COM components.
Furthermore, you cannot cause assemblies from other locations to be displayed in this list in VSA by adding other folder names under the AssemblyFolders
registry key, as described in the Microsoft Knowledge Base for use with Visual Studio. For more information, see see How to display an assembly in the Add Reference dialog box.

Here are some step by step guidance to add your custom assembly to the Script Task
============
* Make a new Visual Studio 2005 project such as VB class library, or C# class library. Write the bulk of your code in your favorite language.
One your are done with your coding, take the next steps before compiling the final version.

============
* Get a public/private key so your assembly can be compiled into having a strong name using the utility sn.exe.

Match the name to your assemblies name such as myapp. C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe -k myapp.key

============
* Put the Key into your Visual Studio project folder for your app:
C:\Documents and Settings\jasonh\My Documents\Visual Studio 2005\Projects\MyApp\myapp.key

============
* Add the moved key location to your project's automatically generated assembly info for the next compilation. Relative folder location is fine... you
might have to add ..\..\myapp.key depending on where you put your key.

In your solution explorer, check the option to show all files. For VB: Open AssemblyInfo.vb
Add the line <Assembly: AssemblyKeyFile("myapp.key")>

For C#: Open AssemblyInfo
Add the line [assembly:AssemblyKeyFile("myapp.key")]

Now recompile the project, and the assembly should be be signed with the key you provided.

============
* Put your signed file into a common folder that VSA checks for references.
Note that VSA doesn't allow many locations by default and there is not a Browse button.


Put your file in one of these two places:
"C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.<whatever >\"

* Now install your assembly into the Global Assembly Cache using gacutil:
gacutil /i "C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\myapp.dll"

============
* Open your SSIS Package and edit your script task.
- Design the script.
- On the Project Explorer pane, right click on References to [add a reference].
- Your assembly should show up in the list now of references you can add in alphabetical order. Click the Add button.
- Put the imports word into your script code... "Imports MyApp"
- Now instantiate your new assembly into an object in your script code and use the methods you have written against your new object.

Public Sub Main()
Dim instance As MyApp = New MyApp
Dim answer As Integer = instance.somemethod("parm1", "param2")
MsgBox(answer)
End Sub

============
--------------------------------------------------------------------------------------------------------------------------
Abbreviation:
VSA: Visual Studio for Applications environment


Hope this helps. If you have any other questions or concerns, please feel free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #5  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Create Assembly for Referencing in ScriptComponent - 09-22-2008 , 10:38 PM



Hi Mirek,
Thank you for using Microsoft MSDN Managed Newsgroup. My name is Charles and I am glad to work with you on this issue.

From your description, I understand that you would like to know how to add your custom assembly in the script editor in dataflow scriptcomponent.
If I have misunderstood, please feel free to let me know.

This is a common seen question and I recommend that you refer to Wei Lu's answer in this old thread:
http://www.microsoft.com/communities...1b5&cat=en-us-
msdn&lang=en&cr=US&sloc=en-us&m=1&p=1

Anyway for your reading convenience, I would like to extract the main part of his answer here:
-----------------------------------------------------------------------------------------------------------------------------
The Add Reference dialog box in VSA does not include the Browse button that is present in Microsoft Visual Studio for locating and referencing other
managed assemblies, and does not include the COM tab for referencing COM components.
Furthermore, you cannot cause assemblies from other locations to be displayed in this list in VSA by adding other folder names under the AssemblyFolders
registry key, as described in the Microsoft Knowledge Base for use with Visual Studio. For more information, see see How to display an assembly in the Add Reference dialog box.

Here are some step by step guidance to add your custom assembly to the Script Task
============
* Make a new Visual Studio 2005 project such as VB class library, or C# class library. Write the bulk of your code in your favorite language.
One your are done with your coding, take the next steps before compiling the final version.

============
* Get a public/private key so your assembly can be compiled into having a strong name using the utility sn.exe.

Match the name to your assemblies name such as myapp. C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe -k myapp.key

============
* Put the Key into your Visual Studio project folder for your app:
C:\Documents and Settings\jasonh\My Documents\Visual Studio 2005\Projects\MyApp\myapp.key

============
* Add the moved key location to your project's automatically generated assembly info for the next compilation. Relative folder location is fine... you
might have to add ..\..\myapp.key depending on where you put your key.

In your solution explorer, check the option to show all files. For VB: Open AssemblyInfo.vb
Add the line <Assembly: AssemblyKeyFile("myapp.key")>

For C#: Open AssemblyInfo
Add the line [assembly:AssemblyKeyFile("myapp.key")]

Now recompile the project, and the assembly should be be signed with the key you provided.

============
* Put your signed file into a common folder that VSA checks for references.
Note that VSA doesn't allow many locations by default and there is not a Browse button.


Put your file in one of these two places:
"C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.<whatever >\"

* Now install your assembly into the Global Assembly Cache using gacutil:
gacutil /i "C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\myapp.dll"

============
* Open your SSIS Package and edit your script task.
- Design the script.
- On the Project Explorer pane, right click on References to [add a reference].
- Your assembly should show up in the list now of references you can add in alphabetical order. Click the Add button.
- Put the imports word into your script code... "Imports MyApp"
- Now instantiate your new assembly into an object in your script code and use the methods you have written against your new object.

Public Sub Main()
Dim instance As MyApp = New MyApp
Dim answer As Integer = instance.somemethod("parm1", "param2")
MsgBox(answer)
End Sub

============
--------------------------------------------------------------------------------------------------------------------------
Abbreviation:
VSA: Visual Studio for Applications environment


Hope this helps. If you have any other questions or concerns, please feel free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #6  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Create Assembly for Referencing in ScriptComponent - 09-22-2008 , 10:38 PM



Hi Mirek,
Thank you for using Microsoft MSDN Managed Newsgroup. My name is Charles and I am glad to work with you on this issue.

From your description, I understand that you would like to know how to add your custom assembly in the script editor in dataflow scriptcomponent.
If I have misunderstood, please feel free to let me know.

This is a common seen question and I recommend that you refer to Wei Lu's answer in this old thread:
http://www.microsoft.com/communities...1b5&cat=en-us-
msdn&lang=en&cr=US&sloc=en-us&m=1&p=1

Anyway for your reading convenience, I would like to extract the main part of his answer here:
-----------------------------------------------------------------------------------------------------------------------------
The Add Reference dialog box in VSA does not include the Browse button that is present in Microsoft Visual Studio for locating and referencing other
managed assemblies, and does not include the COM tab for referencing COM components.
Furthermore, you cannot cause assemblies from other locations to be displayed in this list in VSA by adding other folder names under the AssemblyFolders
registry key, as described in the Microsoft Knowledge Base for use with Visual Studio. For more information, see see How to display an assembly in the Add Reference dialog box.

Here are some step by step guidance to add your custom assembly to the Script Task
============
* Make a new Visual Studio 2005 project such as VB class library, or C# class library. Write the bulk of your code in your favorite language.
One your are done with your coding, take the next steps before compiling the final version.

============
* Get a public/private key so your assembly can be compiled into having a strong name using the utility sn.exe.

Match the name to your assemblies name such as myapp. C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe -k myapp.key

============
* Put the Key into your Visual Studio project folder for your app:
C:\Documents and Settings\jasonh\My Documents\Visual Studio 2005\Projects\MyApp\myapp.key

============
* Add the moved key location to your project's automatically generated assembly info for the next compilation. Relative folder location is fine... you
might have to add ..\..\myapp.key depending on where you put your key.

In your solution explorer, check the option to show all files. For VB: Open AssemblyInfo.vb
Add the line <Assembly: AssemblyKeyFile("myapp.key")>

For C#: Open AssemblyInfo
Add the line [assembly:AssemblyKeyFile("myapp.key")]

Now recompile the project, and the assembly should be be signed with the key you provided.

============
* Put your signed file into a common folder that VSA checks for references.
Note that VSA doesn't allow many locations by default and there is not a Browse button.


Put your file in one of these two places:
"C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.<whatever >\"

* Now install your assembly into the Global Assembly Cache using gacutil:
gacutil /i "C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\myapp.dll"

============
* Open your SSIS Package and edit your script task.
- Design the script.
- On the Project Explorer pane, right click on References to [add a reference].
- Your assembly should show up in the list now of references you can add in alphabetical order. Click the Add button.
- Put the imports word into your script code... "Imports MyApp"
- Now instantiate your new assembly into an object in your script code and use the methods you have written against your new object.

Public Sub Main()
Dim instance As MyApp = New MyApp
Dim answer As Integer = instance.somemethod("parm1", "param2")
MsgBox(answer)
End Sub

============
--------------------------------------------------------------------------------------------------------------------------
Abbreviation:
VSA: Visual Studio for Applications environment


Hope this helps. If you have any other questions or concerns, please feel free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #7  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Create Assembly for Referencing in ScriptComponent - 09-22-2008 , 10:38 PM



Hi Mirek,
Thank you for using Microsoft MSDN Managed Newsgroup. My name is Charles and I am glad to work with you on this issue.

From your description, I understand that you would like to know how to add your custom assembly in the script editor in dataflow scriptcomponent.
If I have misunderstood, please feel free to let me know.

This is a common seen question and I recommend that you refer to Wei Lu's answer in this old thread:
http://www.microsoft.com/communities...1b5&cat=en-us-
msdn&lang=en&cr=US&sloc=en-us&m=1&p=1

Anyway for your reading convenience, I would like to extract the main part of his answer here:
-----------------------------------------------------------------------------------------------------------------------------
The Add Reference dialog box in VSA does not include the Browse button that is present in Microsoft Visual Studio for locating and referencing other
managed assemblies, and does not include the COM tab for referencing COM components.
Furthermore, you cannot cause assemblies from other locations to be displayed in this list in VSA by adding other folder names under the AssemblyFolders
registry key, as described in the Microsoft Knowledge Base for use with Visual Studio. For more information, see see How to display an assembly in the Add Reference dialog box.

Here are some step by step guidance to add your custom assembly to the Script Task
============
* Make a new Visual Studio 2005 project such as VB class library, or C# class library. Write the bulk of your code in your favorite language.
One your are done with your coding, take the next steps before compiling the final version.

============
* Get a public/private key so your assembly can be compiled into having a strong name using the utility sn.exe.

Match the name to your assemblies name such as myapp. C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe -k myapp.key

============
* Put the Key into your Visual Studio project folder for your app:
C:\Documents and Settings\jasonh\My Documents\Visual Studio 2005\Projects\MyApp\myapp.key

============
* Add the moved key location to your project's automatically generated assembly info for the next compilation. Relative folder location is fine... you
might have to add ..\..\myapp.key depending on where you put your key.

In your solution explorer, check the option to show all files. For VB: Open AssemblyInfo.vb
Add the line <Assembly: AssemblyKeyFile("myapp.key")>

For C#: Open AssemblyInfo
Add the line [assembly:AssemblyKeyFile("myapp.key")]

Now recompile the project, and the assembly should be be signed with the key you provided.

============
* Put your signed file into a common folder that VSA checks for references.
Note that VSA doesn't allow many locations by default and there is not a Browse button.


Put your file in one of these two places:
"C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.<whatever >\"

* Now install your assembly into the Global Assembly Cache using gacutil:
gacutil /i "C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\myapp.dll"

============
* Open your SSIS Package and edit your script task.
- Design the script.
- On the Project Explorer pane, right click on References to [add a reference].
- Your assembly should show up in the list now of references you can add in alphabetical order. Click the Add button.
- Put the imports word into your script code... "Imports MyApp"
- Now instantiate your new assembly into an object in your script code and use the methods you have written against your new object.

Public Sub Main()
Dim instance As MyApp = New MyApp
Dim answer As Integer = instance.somemethod("parm1", "param2")
MsgBox(answer)
End Sub

============
--------------------------------------------------------------------------------------------------------------------------
Abbreviation:
VSA: Visual Studio for Applications environment


Hope this helps. If you have any other questions or concerns, please feel free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #8  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Create Assembly for Referencing in ScriptComponent - 09-22-2008 , 10:38 PM



Hi Mirek,
Thank you for using Microsoft MSDN Managed Newsgroup. My name is Charles and I am glad to work with you on this issue.

From your description, I understand that you would like to know how to add your custom assembly in the script editor in dataflow scriptcomponent.
If I have misunderstood, please feel free to let me know.

This is a common seen question and I recommend that you refer to Wei Lu's answer in this old thread:
http://www.microsoft.com/communities...1b5&cat=en-us-
msdn&lang=en&cr=US&sloc=en-us&m=1&p=1

Anyway for your reading convenience, I would like to extract the main part of his answer here:
-----------------------------------------------------------------------------------------------------------------------------
The Add Reference dialog box in VSA does not include the Browse button that is present in Microsoft Visual Studio for locating and referencing other
managed assemblies, and does not include the COM tab for referencing COM components.
Furthermore, you cannot cause assemblies from other locations to be displayed in this list in VSA by adding other folder names under the AssemblyFolders
registry key, as described in the Microsoft Knowledge Base for use with Visual Studio. For more information, see see How to display an assembly in the Add Reference dialog box.

Here are some step by step guidance to add your custom assembly to the Script Task
============
* Make a new Visual Studio 2005 project such as VB class library, or C# class library. Write the bulk of your code in your favorite language.
One your are done with your coding, take the next steps before compiling the final version.

============
* Get a public/private key so your assembly can be compiled into having a strong name using the utility sn.exe.

Match the name to your assemblies name such as myapp. C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe -k myapp.key

============
* Put the Key into your Visual Studio project folder for your app:
C:\Documents and Settings\jasonh\My Documents\Visual Studio 2005\Projects\MyApp\myapp.key

============
* Add the moved key location to your project's automatically generated assembly info for the next compilation. Relative folder location is fine... you
might have to add ..\..\myapp.key depending on where you put your key.

In your solution explorer, check the option to show all files. For VB: Open AssemblyInfo.vb
Add the line <Assembly: AssemblyKeyFile("myapp.key")>

For C#: Open AssemblyInfo
Add the line [assembly:AssemblyKeyFile("myapp.key")]

Now recompile the project, and the assembly should be be signed with the key you provided.

============
* Put your signed file into a common folder that VSA checks for references.
Note that VSA doesn't allow many locations by default and there is not a Browse button.


Put your file in one of these two places:
"C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.<whatever >\"

* Now install your assembly into the Global Assembly Cache using gacutil:
gacutil /i "C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\myapp.dll"

============
* Open your SSIS Package and edit your script task.
- Design the script.
- On the Project Explorer pane, right click on References to [add a reference].
- Your assembly should show up in the list now of references you can add in alphabetical order. Click the Add button.
- Put the imports word into your script code... "Imports MyApp"
- Now instantiate your new assembly into an object in your script code and use the methods you have written against your new object.

Public Sub Main()
Dim instance As MyApp = New MyApp
Dim answer As Integer = instance.somemethod("parm1", "param2")
MsgBox(answer)
End Sub

============
--------------------------------------------------------------------------------------------------------------------------
Abbreviation:
VSA: Visual Studio for Applications environment


Hope this helps. If you have any other questions or concerns, please feel free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
  #9  
Old   
Charles Wang [MSFT]
 
Posts: n/a

Default RE: Create Assembly for Referencing in ScriptComponent - 09-22-2008 , 10:38 PM



Hi Mirek,
Thank you for using Microsoft MSDN Managed Newsgroup. My name is Charles and I am glad to work with you on this issue.

From your description, I understand that you would like to know how to add your custom assembly in the script editor in dataflow scriptcomponent.
If I have misunderstood, please feel free to let me know.

This is a common seen question and I recommend that you refer to Wei Lu's answer in this old thread:
http://www.microsoft.com/communities...1b5&cat=en-us-
msdn&lang=en&cr=US&sloc=en-us&m=1&p=1

Anyway for your reading convenience, I would like to extract the main part of his answer here:
-----------------------------------------------------------------------------------------------------------------------------
The Add Reference dialog box in VSA does not include the Browse button that is present in Microsoft Visual Studio for locating and referencing other
managed assemblies, and does not include the COM tab for referencing COM components.
Furthermore, you cannot cause assemblies from other locations to be displayed in this list in VSA by adding other folder names under the AssemblyFolders
registry key, as described in the Microsoft Knowledge Base for use with Visual Studio. For more information, see see How to display an assembly in the Add Reference dialog box.

Here are some step by step guidance to add your custom assembly to the Script Task
============
* Make a new Visual Studio 2005 project such as VB class library, or C# class library. Write the bulk of your code in your favorite language.
One your are done with your coding, take the next steps before compiling the final version.

============
* Get a public/private key so your assembly can be compiled into having a strong name using the utility sn.exe.

Match the name to your assemblies name such as myapp. C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe -k myapp.key

============
* Put the Key into your Visual Studio project folder for your app:
C:\Documents and Settings\jasonh\My Documents\Visual Studio 2005\Projects\MyApp\myapp.key

============
* Add the moved key location to your project's automatically generated assembly info for the next compilation. Relative folder location is fine... you
might have to add ..\..\myapp.key depending on where you put your key.

In your solution explorer, check the option to show all files. For VB: Open AssemblyInfo.vb
Add the line <Assembly: AssemblyKeyFile("myapp.key")>

For C#: Open AssemblyInfo
Add the line [assembly:AssemblyKeyFile("myapp.key")]

Now recompile the project, and the assembly should be be signed with the key you provided.

============
* Put your signed file into a common folder that VSA checks for references.
Note that VSA doesn't allow many locations by default and there is not a Browse button.


Put your file in one of these two places:
"C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.<whatever >\"

* Now install your assembly into the Global Assembly Cache using gacutil:
gacutil /i "C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\myapp.dll"

============
* Open your SSIS Package and edit your script task.
- Design the script.
- On the Project Explorer pane, right click on References to [add a reference].
- Your assembly should show up in the list now of references you can add in alphabetical order. Click the Add button.
- Put the imports word into your script code... "Imports MyApp"
- Now instantiate your new assembly into an object in your script code and use the methods you have written against your new object.

Public Sub Main()
Dim instance As MyApp = New MyApp
Dim answer As Integer = instance.somemethod("parm1", "param2")
MsgBox(answer)
End Sub

============
--------------------------------------------------------------------------------------------------------------------------
Abbreviation:
VSA: Visual Studio for Applications environment


Hope this helps. If you have any other questions or concerns, please feel free to let me know. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
================================================== =========
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com.
================================================== =========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================== ==========
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== =======





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.