2017-02-22 1 views
0

w3wp에서 프로세스로 시작하는 콘솔 응용 프로그램이 있습니다. 응용 프로그램은 웹 사이트 폴더 아래의 파일을 조작해야합니다. AnonymousPipeServerStream을 사용하여 콘솔 앱과 통신하기로 결정할 때까지 (콘솔 앱에서 메시지를 받고 싶습니다.) 모든 것이 제대로 작동했습니다.AnonymousPipeServerStream을 사용할 때 w3wp에서 시작한 콘솔 응용 프로그램에서 System.UnauthorizedAccessException이 throw됩니다.

 var pipeServer = new AnonymousPipeServerStream(PipeDirection.In); 
     var pipeStreamReader = new StreamReader(pipeServer); 

     ProcessStartInfo si = new ProcessStartInfo(fileName); 
     si.Arguments = $"{pipeServer.GetClientHandleAsString()} {arguments}"; 
     si.CreateNoWindow = true; 
     si.UseShellExecute = false; 
     si.RedirectStandardError = true; 
     si.RedirectStandardOutput = true; 

이 코드가 추가 된 후 콘솔 응용 프로그램은 예외로 충돌 시작

System.UnauthorizedAccessException : 경로 'C에 대한 접근 : \을 Inetpub \ wwwroot에 \ ...이 거부됩니다. 예외가 발생

코드 : 예상대로 AnonymousPipeServerStream의 모든 작품에

File.Open(this.Path, FileMode.CreateNew); 

나는 코드를 주석 처리합니다.

AnonymousPipeServerStream이 콘솔 응용 프로그램이 시작되는 주체 또는 이러한 동작을 유발할 수있는 아이디어가 변경 될 수 있습니까?

+0

어떤 명령어가 예외 (호출 스택)를 던지고 있습니까? – dlatikay

+0

File.Open (this.Path, FileMode.CreateNew);로 파일을 만들려고합니다. –

답변

0

이것은 연결된 파이프가 아닌 코드에서 오류가있는 것으로 보입니다. 죄송합니다 소음에 대한

관련 문제