title: This stream does not support seek operations, using stream
body: <p>Using C# ASP.net 4.5, Nopcommerce CMS, MVC 4 and visual studio 2012.</p>
  <p>This seems to be a familiar problem people have, I,ve searched the &quot;googles&quot; and have yet to find a solution fitting my need.</p>
  <p>please note, this is not my code, I was asked to fix this issue (I also have limited knowledge on file I/O, just the basics).</p>
  <p>The error stack trace is:</p>
  <pre><code>&quot;   at System.Net.ConnectStream.set_Position(Int64 value)\r\n   at   Hroc.Plugin.Core.CsvProductManagement.Services.CsvReader.Initialise(Stream stream, Encoding encoding)\r\n   at Hroc.Plugin.Core.CsvProductManagement.Services.CsvReader..ctor(Stream stream)\r\n   at Hroc.Plugin.Core.CsvProductManagement.Services.ImportService.ImportStoreProductsFromCsv(Stream stream, Int32 storeContext, Int32 vendorId, Boolean deleteUnmatched)\r\n   at Hroc.Plugin.Core.CsvProductManagement.Services.StaticImportFile.GetStoreProductImportMessages(Stream stream, Int32 storeContext, Int32 vendorId, Boolean deleteUnmatched)\r\n   at Hroc.Plugin.Core.CsvProductManagement.Tasks.ImportFilesTask.Execute()\r\n   at Nop.Services.Tasks.Task.Execute(Boolean throwException) in c:\\Users\\stevesmith\\Documents\\GitHub\\Store\\Libraries\\Nop.Services\\Tasks\\Task.cs:line 83&quot;
  </code></pre>
  <p>now for the code, ill try to keep it as short as possible (its is MVC though so prepare for 101 different methods...</p>
  <pre><code>public void Execute() {
          if (_importTaskSettings.Enabled) {
              var response = HttpWebRequest.Create(_importTaskSettings.ImportFileUrl).GetResponse();
              
              if (response != null)
              {
                  using (var stream = response.GetResponseStream())
                  {
                      var messages = StaticImportFile.GetStoreProductImportMessages(stream, 0, 1, true); //error occurs here
                      _logger.Information(string.Format(&quot;Import Store products file task complete. Messages: {0}&quot;, string.Join(&quot;, &quot;, messages))); 
                  }
              }
              else {
                  //_logger.Information('import was called but is null');
              }
          }
      }
  </code></pre>
  <p>this methods gets used on a timer withing a background task, for debugging purposes its currently set to 30 seconds.</p>
  <pre><code>public virtual IList&lt;string&gt; ImportStoreProductsFromCsv(Stream stream, int storeContext = 0, int vendorId = 0, bool deleteUnmatched = false) {
          // Store always uploads against all stores
          storeContext = 0;
  
          using (var s = new CsvReader(stream)) {
              // read CSV file stream into List
  .....etc etc
  }
  </code></pre>
  <p>and of course the error is located on the using system CsvReader.</p>
  <pre><code> /// &lt;summary&gt;
      /// Initialises the reader to work from an existing stream
      /// &lt;/summary&gt;
      /// &lt;param name=&quot;stream&quot;&gt;Stream&lt;/param&gt;
      public CsvReader(Stream stream) {
          _type = Type.Stream;
          Initialise(stream, Encoding.Default);
      }
  </code></pre>
  <p>Ok, so the above is a small snippet of the actual code rooted deep with nop commerce and custom plugins. however i believe the fault lies some where in the process of the stream.</p>
  <p>The purpose here is that a file living somewhere on the server gets updated every hour.
  The Admins do not have access to the file, but there products also need updating.
  As such a task runs which find the path creates a stream, and uses nop commerce's methods to input the file data into the stores website.</p>
  <p>Now reading a lot of forums most people say its the act of trying to write from the open stream whilst trying to seek?(not sure if worded that correctly) And from this the actual process doesn't make sense of trying to seek in the stream?</p>
  <p>I'm hoping my error is something small, I do not wish to have to create a new plugin and extend of Nop anymore than i need too.</p>
  <p>If you require any more information, let me know and ill update this question.</p>