SSIS (any pre 2012) - Error Cannot apply indexing with [] to an expression of type 'Microsoft.SqlServer.Dts.Runtime.Variables' - by ArthurZ

Status : 

  Not Reproducible<br /><br />
		The product team could not reproduce this item with the description and steps provided.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


17
0
Sign in
to vote
ID 744390 Comments
Status Closed Workarounds
Type Bug Repros 4
Opened 5/27/2012 7:36:19 PM
Access Restriction Public

Description

Unable to create scripts in Script Task of SSIS after installing SSIS 2012.

Upon opening the Script Editor and adding code to get a variable content I get error:
Error	1	Cannot apply indexing with [] to an expression of type 'Microsoft.SqlServer.Dts.Runtime.Variables'

And indeed, I can see the reference to Microsoft.SqlServer.ManagedDTS marked with a yellow icon.
This happened after a side by side complete installation of SQL Server 2012 (already have SQL Server 2008 and 2008 R2 full installs).
Sign in to post a comment.
Posted by Microsoft on 12/4/2014 at 2:13 AM
Thank you for submitting this feedback. After carefully evaluating the bug and trying to reproduce the issue based on the information provided, we are not able to do so. Therefore, we are closing the bug as Not Repro.

Verified Steps:
OS: Windows Server 2012
1. Install SQL Server 2008 and 2008 R2.
2. Create a project named "ScriptTaskTest" in BIDS (VS 2008): Add a ScriptTask to it. And add the code:
    MessageBox.Show(Dts.Variables["User::Variable"].Value.ToString());
    It could work.
3. Install SQL Server 2012. (During this step, it would ask us to setup vs2010 SP1 pack).
4. Create a project named "NewScriptTaskTest" in BIDS (VS 2008): Add a ScriptTask to it. And add the code:
    MessageBox.Show(Dts.Variables["User::Variable"].Value.ToString());
    It could also work.
5. Add another ScriptTask and swith language to VB. It works too.
--------------------------------------------------------------------
For the problem that intelligence gives warning as per title and Microsoft.SqlServer.ManagedDts reference has a yellow warning triangle, please check whether the Microsoft.SqlServer.ManagedDts is in your SQL Server install folder such as C:\Program Files (x86)\Microsoft SQL Server\100\SDK\Assemblies.

Besides, the assembly is strong named which store in different folder that combine <TargetFrameworkVersion>.<AssemblyVersion>.<PublicKeyToken>, it could distinguish each version assembly correctly. And for SSDTBI for VS 2008, because its build depends on .net framework 2.0, the Microsoft.SqlServer.ManagedDts should be in C:\Windows\assembly, while for the newer version the assembly should be in C:\Windows\Microsoft.NET\assembly\GAC_MSIL. Please check whether the corresponding assembly is in correct folder.

--------------------------------------------------------------------
If the issue persists, we would like to ask you to resubmit the issue with more details and information that would help us to reproduce the issue.

Thanks again for reporting the product issue and continued support in improving our product.
Posted by CraigIW2 on 5/14/2014 at 5:31 AM
Stated workaround does not work for me as the files do not exist. I have SQL 2008 Developer edition installed. All was fine with BIDS until I installed SQL 2014 Management Studio. Can confirm that script runs, but intellisense gives warning as per title and Microsoft.SqlServer.ManagedDts reference has a yellow warning triangle.
Posted by Dmitriy Gavrikov on 5/7/2013 at 9:16 PM
2Chame_che,
Thank you, what the doctor ordered. SQL Server 2008 R2 SP2
Posted by Sudeep Raj on 7/16/2012 at 11:28 AM
@Chema_che thanks for pointing out the workaround. It worked like it should :)
Posted by Microsoft on 7/3/2012 at 1:37 AM
Hi Arthur,
Thanks for your feedback. We find it builds successfully even though it throws intellisense error in the first compiling. Please see the analysis and workaround here: http://support.microsoft.com/kb/938608/en-us
We're actively looking at it.
Posted by Chema_che on 6/12/2012 at 4:29 AM
This may help
http://support.microsoft.com/kb/938608/en-us/