title: Save file to Azure DevOps folder like /home/vsts/work/1/s/ from C# console application
body: <p>I am trying to do some processing inside a C# console application and that file has to be saved:</p>
  <pre><code>File.WriteAllText(&quot;C:\JSONOutput\output.md&quot;), htmlResult);
  </code></pre>
  <p>I want save it to Azure DevOps folder like '/home/vsts/work/1/s/' so that it can be accessed again in the next step where I am uploading the file to artifacts using a statement like below:</p>
  <pre><code>Write-Host &quot;##vso[artifact.upload containerfolder=testresult;artifactname=worksoftHTML;]/home/vsts/work/1/s/output.html&quot;
  </code></pre>
  <p>So far I have tried by writing the following but it is not working:</p>
  <pre><code>File.WriteAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @&quot;/home/vsts/work/1/s/output.md&quot;), htmlResult);
  </code></pre>
  <p>and this also:</p>
  <pre><code>File.WriteAllText(&quot;../home/vsts/work/1/s/output.md&quot;, htmlResult);
  </code></pre>
  <p>It is also not working.Please help.
  I have tried the following as well in the pipeline where I am passing the filepath as a parameter to the program in command line:</p>
  <pre><code>- task: CmdLine@2 
    env:     
        InputJSON: $(testJSON)  
    inputs:  
      script: 
          echo $(testJSON)               
          'jsonProcessor.exe $(Build.ArtifactStagingDirectory)\dropfile\,%INPUTJSON%'     
      workingDirectory: './jsonProcExe/'
  </code></pre>
  <p>Inside the exe I am writing the file like below:</p>
  <pre><code>File.WriteAllText(Path.Combine(filePath, @&quot;output.html&quot;), finalHtml);
  </code></pre>
  <p>And then in the next step I am reading the files like this:</p>
  <pre><code>- task: PowerShell@2
    inputs:
      targetType: 'inline'
      script: |
        # Write your PowerShell commands here.      
        Write-Host &quot;##vso[artifact.upload containerfolder=testresult;artifactname=worksoftHTML;]$(Build.ArtifactStagingDirectory)\dropfile\output.html&quot;
  </code></pre>
  <p>But still I am getting the error</p>
  <pre><code>Path does not exist: C:\agent\_work\1\a\dropfile\output.html
  </code></pre>
  <p>Please note that I am using a self hosted agent.</p>