title: SSIS/SSRS-The variable "MyNameSpace::MyVariableName" specified by VariableName property is not a valid variable
body: <p>Environment: SQL Server 2008 R2</p>
  
  <p>I keep getting this error on a scheduled job running on SQL Server 2008 R2:</p>
  
  <pre><code>Error: Code: 0xC02020EE     Source: Data Flow Task - Fix Missing this and that Row Count - This Not Fixed [148]     Description: The variable "MyNameSpace::MyVariableName" specified by VariableName property is not a valid variable. Need a valid variable name to write to.  End Error
  </code></pre>
  
  <p>I cannot make out what could be wrong here. The variable is declared in the dtsx like this:</p>
  
  <pre><code>&lt;DTS:Variable&gt;
      &lt;DTS:Property DTS:Name="Expression"/&gt;
      &lt;DTS:Property DTS:Name="EvaluateAsExpression"&gt;0&lt;/DTS:Property&gt;
      &lt;DTS:Property DTS:Name="NameSpace"&gt;MyNameSpace&lt;/DTS:Property&gt;
      &lt;DTS:Property DTS:Name="ReadOnly"&gt;0&lt;/DTS:Property&gt;
      &lt;DTS:Property DTS:Name="RaiseChangedEvent"&gt;-1&lt;/DTS:Property&gt;
      &lt;DTS:Property DTS:Name="IncludeInDebugDump"&gt;6789&lt;/DTS:Property&gt;
      &lt;DTS:VariableValue DTS:DataType="3"&gt;0&lt;/DTS:VariableValue&gt;
      &lt;DTS:Property DTS:Name="ObjectName"&gt;MyVariableName&lt;/DTS:Property&gt;
      &lt;DTS:Property DTS:Name="DTSID"&gt;{F6C30C52-3BDA-45D6-862B-10405215FABC}&lt;/DTS:Property&gt;
      &lt;DTS:Property DTS:Name="Description"/&gt;
      &lt;DTS:Property DTS:Name="CreationName"/&gt;
  &lt;/DTS:Variable&gt;
  </code></pre>
  
  <p>And it is being used like this:</p>
  
  <pre><code>&lt;component id="148" name="Row Count - IDs Not Fixed" componentClassID="{150E6007-7C6A-4CC3-8FF3-FC73783A972E}" description="Counts the rows in a dataset." localeId="-1" usesDispositions="false" validateExternalMetadata="True" version="0" pipelineVersion="0" contactInfo="Row Count;Microsoft Corporation; Microsoft SqlServer v10; (C) Microsoft Corporation; All Rights Reserved; http://www.microsoft.com/sql/support;0"&gt;
                      &lt;properties&gt;
                          &lt;property id="149" name="VariableName" dataType="System.String" state="default" isArray="false" description="Specifies the variable to hold the row count." typeConverter="" UITypeEditor="" containsID="false" expressionType="None"&gt;MyNameSpace::MyVariableName&lt;/property&gt;
                      &lt;/properties&gt;
                      &lt;inputs&gt;
                          &lt;input id="150" name="Row Count Input 1" description="" hasSideEffects="true" dangling="false" errorOrTruncationOperation="" errorRowDisposition="NotUsed" truncationRowDisposition="NotUsed"&gt;
                              &lt;externalMetadataColumns isUsed="False"/&gt;
                          &lt;/input&gt;
                      &lt;/inputs&gt;
                      &lt;outputs&gt;
                          &lt;output id="151" name="Row Count Output 1" description="" exclusionGroup="0" synchronousInputId="150" deleteOutputOnPathDetached="false" hasSideEffects="false" dangling="false" isErrorOut="false" isSorted="false" errorOrTruncationOperation="" errorRowDisposition="NotUsed" truncationRowDisposition="NotUsed"&gt;
                              &lt;externalMetadataColumns isUsed="False"/&gt;
                          &lt;/output&gt;
                      &lt;/outputs&gt;
                  &lt;/component&gt;
  </code></pre>
  
  <p>Can someone help me understand what needs to be corrected to avoid this error? Googling this error has not helped so far.</p>