-1

I am having problem with PCSP hanging.

  • PCSP is called from within a WCF service running in IIS on Windows 2008 r2.
  • The service is running under an app pool that is running as a domain user
  • the host key has been cached for that user
  • A client will call the service across the local network
  • The service will get this message and transfer the file accross to the external site

However, this will only work if the user that the app pool/service is running as is logged into Remote Desktop

As soon as the Remote Desktop session is ended and another call is made from the client the call to PCSP will just hang.

The command and arguments that are made to PSCP are below. Followed by the code that is used to call the command

        pscp.exe -pw APassword  -P 22 -sftp -q -batch "\\AServer\AFolder\AFile.csv" auser@service:/adirectory


        System.Diagnostics.Process proc = new System.Diagnostics.Process();
        proc.StartInfo.FileName = executablePath;
        proc.StartInfo.RedirectStandardError = true;
        proc.StartInfo.RedirectStandardOutput = true;
        proc.StartInfo.UseShellExecute = false;
        proc.StartInfo.LoadUserProfile = true;
        proc.StartInfo.Arguments = arguments;

        proc.Start();

        proc.WaitForExit(60 * 60 * 5);

I suspect it has something to do with the getting of the host key from the registry but for the life of me cant work out what that may be. Any help with this would be greatly appreciated

KiwiInLondon
  • 59
  • 10

1 Answers1

0

After 2 days banging my head on a brick wall I found the answer.

Under the app pool settings go to Advanced Settings and there under ProcessModel is a setting to "Load User Profile" Set this to true!

KiwiInLondon
  • 59
  • 10