[
  {
    "Id": "1485221",
    "ThreadId": "658457",
    "Html": "I've used this to create password protected zip file in the windows service. When I deploy the service on the server it gives error &quot;could not find a part of the path C:\\Windows\\System32\\TEmp\\DotNetZip-ewtkhsc.tn&quot; on zip.Save() line. I set below property to overcome this problem. \r<br />\n<br />\nzip.TempFileFolder = applicationPath + &quot;\\Temp&quot;;\r<br />\n<br />\nThe path given above is the valid one and service has all permission (read, write) to this path. Still zip.Save() is giving me &quot;could not find a part of the path&quot; error.\r<br />\n<br />\nAny help would be appreciated.\r<br />\n<br />\nThanks in advance.<br />\n",
    "PostedDate": "2016-10-04T00:12:52.293-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "1488737",
    "ThreadId": "658457",
    "Html": "I would suggest your path is wrong.<br />\n<br />\nzip.TempFileFolder = applicationPath + &quot;\\Temp&quot;; <br />\n<br />\n&quot;\\temp&quot; - the first two characters &quot;\\t&quot; are escape sequence for a tab character, so you're actually getting:<br />\nzip.TempFileFolder = applicationPath + &quot;&lt;tab character&gt;emp&quot;;<br />\n<br />\ntry either:<br />\n<br />\nzip.TempFileFolder = applicationPath + @&quot;\\Temp&quot;; <br />\nzip.TempFileFolder = applicationPath + &quot;\\Temp&quot;; <br />\n<br />\nor better yet:  zip.TempFileFolder = Path.Combine(applicationPath + @&quot;\\Temp&quot;); <br />\n<br />\nAlso, when running as a service, it will generally run as either:  NETWORK SERVICE, LOCAL SERVICE, LOCAL SYSTEM or a named user if you impersonate a user's account login.<br />\nWhat I'm trying to say is you may have access to the path (read &amp; write access) but the account the service is actually running as: NETWORK SERVICE (for example) may not.  To check what your service is running as.  Load: services.msc, find your service, and click on the &quot;Log On&quot; tab.<br />\n",
    "PostedDate": "2016-11-24T07:10:25.203-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]