Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
1.44/5 (3 votes)
See more:
I have a one program in vb.net in that i use outlook reference and i call that outlook with all fields are automatically filed (i.e)to address,subject,message and attachment.I take that code from this web site (open default email client). If i run that program in local drive it works well and open outlook and filled all fields but i paste that program on IIS and if i run that program it show the error.

Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

pls reply for above question

simple code to check in IIS
System.Diagnostics.Process.Start("calc") just paste this code in click event and run.in local drive u get calculator but u run from IIS it doesn't open calculator but if u see in task manger u see calc.exe is run in the process
Posted

Oh good grief!

This is a very common question, raised by people who have no idea what they are doing... When you execute the method Process.Start, is it executed in the code behind. Which runs on the server, not the client. So any process you start, and any executable file that runs, runs on the server, not the client. So your user cannot see it.

When you tested this on your local machine, the server and and the client were the same computer, so it looked as if it worked. It doesn't. There is no practical way to run programs on a client computer - you cannot even tell if the client is a PC, a MAc, a mobile phone or a refrigerator with internet access. Note that I say "practical" - there are a couple of ways to do it, but they all require the prior consent and enthusiastic help of the user, which is not going to be forthcoming in 99.999% of cases.

Drop the idea. It won't work.
 
Share this answer
 
Comments
Aravindbpanchu 25-Jul-12 22:44pm    
simple code to check in IIS
System.Diagnostics.Process.Start("calc") just paste this code in click event and run.in local drive u get calculator but u run from IIS it doesn't open calculator but if u see in task manger u see calc.exe is run in the process
just check and reply me
Zoltán Zörgő 5-Nov-13 5:06am    
Oh, it does run. As IIS is a service, it is running under a separate session - different from the one you are logged in. So you can't see the application, but it is started. Still, there are only few situations when starting a process on server side from an asp.net application is wise - use this approach only when the application you start is command line application, and never requires user interaction to terminate (even with error condition).
Yeah.
I have the same problem.
I want to open the notepad with a message on the server and it refuses to do it!
It seems to be some sort of security measure. you need to grant more premissions:

http://stackoverflow.com/questions/4679561/system-diagnostics-process-start-not-work-fom-an-iis[^]

http://forums.asp.net/t/1277084.aspx[^]

http://stackoverflow.com/questions/8414514/iis7-does-not-start-my-exe-file-by-process-start[^]
 
Share this answer
 
Comments
Zoltán Zörgő 5-Nov-13 5:07am    
As IIS is a service it is not running under a separate session - different from the one you are logged in, and under a different user account! So you can't see the application, even if it is really started. Still, there are only few situations when starting a process on server side from an asp.net application is wise - use this approach only when the application you start is command line application, and never requires user interaction to terminate (even with error condition).
The solution is that in the same situation if your application was deployed under iis 7.5 on Windows 7 it won't work; but if you deploy the same application under iis 8.5 on Windows 8.1 it will work 100% guaranteed. I have a MVC 4 application that calls a file.exe for pdf generation. The same deploy run under iis 8.5 on Windows 8.1 but doesn't run under iis 7.5 on Windows 7. It crashes in Process.start(). By few words IIS 8.5 is better than iis 7.5. This is the solution, but because of this I can't solve the issue with iis 7.5. It's not funny. I'll accept other solutions.
 
Share this answer
 
v2
Comments
Dave Kreskowiak 12-Jul-15 23:00pm    
First, you're answering a 3 year old question.

Second, the problem was that this guy was trying to execute applications on the CLIENT, which is impossible to do from ASP.NET code since it runs entirely on the server.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900