title: SSIS script task (c#) works in Visual Studio well. But when I run it in SSMS it runs succesfully but does nothing
body: <p>I I prepared a simple <code>c#</code> script that can rename a file on my local directory.  When I run it in <code>visual studio</code> it completes successfully and rename the file. the code below;</p>
  <pre><code>public void Main()
  {
     // TODO: Add your code here
     string path = @&quot;D:\DataFiles\IQVIAData\BrickWeekly\BrickWeeklyData\201226_FACT_ALL_SALES_147.txt&quot;;
     string path2 = @&quot;D:\DataFiles\IQVIAData\BrickWeekly\BrickWeeklyData\ASD.txt&quot;;
     File.Move(path, path2);
     Dts.TaskResult = (int)ScriptResults.Success;
  }
  </code></pre>
  <p>From <code>SSMS</code> when I execute the <code>SSIS</code> package which script task included, it runs and it says succesfully completed but the file is still with the same name and it didn't rename the file.</p>
  <p>Here what I did before texting here,</p>
  <ol>
  <li>I gave permission to folder for everone to modify (full control; read,write...) (İt didn't work)</li>
  </ol>
  <p><a href="https://i.stack.imgur.com/9GqAl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9GqAl.png" alt="enter image description here" /></a></p>
  <ol start="2">
  <li><p>I created a SSIS proxy which refers my admin account and run the script instead sql server agent. (It didn't work)
  <a href="https://i.stack.imgur.com/XcjkV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XcjkV.png" alt="enter image description here" /></a></p>
  </li>
  <li><p>I changed the folder path randomly which does not exist like that path. When I run it visual studio gave error like; there is no folder with this name etc... This was what I expect it. After that I deployed the package to <code>sql server</code> and run the package from <code>SSMS</code>. But it didnt give me any error despite there is a mistake with folder path. It runs succusfully.</p>
  <pre><code>public void Main()
  {
      // TODO: Add your code here
      string path = @&quot;D:\DataFiles\IQVIAData\BrickWeekly\BrickWeeklyData\201226_FACT_ALL_SALES_147.txt&quot;;
      string path2 = @&quot;D:\DataFiles\IQVIAData\BrickWeekly\asdasd\ASD.txt&quot;;
      File.Move(path, path2);
      Dts.TaskResult = (int)ScriptResults.Success;
  }
  </code></pre>
  </li>
  </ol>
  <p>Any ideas or advice to solve my problem?</p>