0

I am developing a system where user interacts with WCF Service hosted in IIS server. The WCF application then have to fire-up winform application along with some parameters. This winform application do some processing and then load a application(software) installed in the server. This application will create some output documents and put it in the share-able folder where user has a access to. [Could not post descriptive picture because of low point :( ]

It is working fine in development environment i.e. output was being created but when I deployed it in IIS, it started throwing error:

System.UnauthorizedAccessException

I tried loading the WinForm using two methods:

  1. Winform is loaded creating a instance of WinForm from WCF host
  2. Instance of WinForm is loaded (.EXE) using System.Process.Start()

Both operation failed. How to achieve this using IIS.

JakubJ
  • 235
  • 4
  • 13
sk3145
  • 174
  • 18
  • What is the error you are getting ? – Kurubaran Apr 23 '15 at 08:33
  • Enabling Tracing on your Web service and add Exception Details in your qustion .. for more info trace .. https://msdn.microsoft.com/en-us/library/vstudio/bb885203(v=vs.100).aspx – Anant Dabhi Apr 23 '15 at 08:43
  • Both throws "System.UnauthorizedAccessException". – sk3145 Apr 23 '15 at 08:43
  • if you getting `System.UnauthorizedAccessException` then Make sure your `AppPool` Have Permission to access your `EXE` File – Anant Dabhi Apr 23 '15 at 08:50
  • That is where I am stuck right now. I tried giving permission to "World Wide Web Publishing Service" through services but it did not worked. – sk3145 Apr 23 '15 at 08:55
  • For troubleshooting, create an AppPool for your service that uses a "normal" user identity, perhaps even with Load User Profile = true. This should get IIS-related problems out of the way so you can narrow it down if it's really IIS & permissions, or elsewhere. – nodots Apr 23 '15 at 09:26
  • I tried giving AppPool "Local System" identity but doind that It started throwing me visual studio runtime excpetion "An unhandled exception of type "System.Runtime.InteropServices.COMException' ". I tried converting the program into x86 too but it did not work. But when I run the application independently, it is working fine. – sk3145 Apr 23 '15 at 10:15
  • try running the apppool under the same credential as you have logged in the computer and then try. in production env you might want to create a service account with same privilege as your login account and run the apppool under that service account – rauts Apr 23 '15 at 13:10
  • I am under domain server and started IIS and VS 2010 using domain temp admin password. How do I set these credentials for AppPool? – sk3145 Apr 24 '15 at 00:27
  • Tried setting AppPool under domainAdmin but it did not solve my problem. I think there is some issue with userSource mapping. Since it is from IIS, there might be some restriction to it. But could not solve it. – sk3145 Apr 30 '15 at 06:53

0 Answers0