I made an asp.net application and two exe files (of my windows application) are added on button click event of my asp.net application. It works fine when i run locally but when i host this website, its not showing me exe files instead these exe files are showing in my task manager.

I made an asp.net application and two exe files (of my windows application) are added on button click event of my asp.net application. It works fine when i run locally but when i host this website, its not showing me exe files instead these exe files are showing in my task manager.

The issue is that the IIS web server runs as a service, and thus doesn't have the same rights as the logged-in user. You must modify the NTFS security settings (in Windows, not .NET) so that the ASPNET user (on the local machine) has the corresponding rights on the EXE file that you want to execute.

To modify these, use the Windows Explorer, right click on the EXE file, choose properties and then the Security tab.

To add the ASPNET user, select "Add", then "Location", the name of your PC (on top of the list), then Advanced and then "Find now". You should see a user named ASPNET. This is the one. It must have Read&Execute rights at least.

For more information: http://support.microsoft.com/default.aspx?scid=kb;en-us;555134

Thanks Poster...
But I could not find ASPNET user.

The issue is that the IIS web server runs as a service, and thus doesn't have the same rights as the logged-in user. You must modify the NTFS security settings (in Windows, not .NET) so that the ASPNET user (on the local machine) has the corresponding rights on the EXE file that you want to execute.

To modify these, use the Windows Explorer, right click on the EXE file, choose properties and then the Security tab.

To add the ASPNET user, select "Add", then "Location", the name of your PC (on top of the list), then Advanced and then "Find now". You should see a user named ASPNET. This is the one. It must have Read&Execute rights at least.

For more information: http://support.microsoft.com/default.aspx?scid=kb;en-us;555134

Thanks Poster...
But I could not find ASPNET user.

As far as I know, ASPNET user account is used by the early IIS and .NET framework version. By Default, In Windows Server 2008 with IIS7, it does not have that account.

You may create a normal user account and granting specific right to do these things.
By default, IIS 7 uses the NETWORK SERVICE account. This is configured by app pool. Go in to IIS, go to Application Pools, then find the application pool that your website is running under. Right click that app pool and select "Advanced Settings". Look for "Identity" under the "Process Model" section. This will tell you which account is being used for this app pool. Also, grant permission rights to "IIS_IUSRS".

I have given fullpermission to the network service as welll as to the IIS_IUSRS but still i cannot se my exe files.

As far as I know, ASPNET user account is used by the early IIS and .NET framework version. By Default, In Windows Server 2008 with IIS7, it does not have that account.

You may create a normal user account and granting specific right to do these things.
By default, IIS 7 uses the NETWORK SERVICE account. This is configured by app pool. Go in to IIS, go to Application Pools, then find the application pool that your website is running under. Right click that app pool and select "Advanced Settings". Look for "Identity" under the "Process Model" section. This will tell you which account is being used for this app pool. Also, grant permission rights to "IIS_IUSRS".

I have given fullpermission to the network service as welll as to the IIS_IUSRS but still i cannot se my exe files.

To launch external *.exe file, you need to use State Server session state mode.
StateServer mode, which stores session state in a separate process called the ASP.NET state service. This ensures that session state is preserved if the Web application is restarted.

You can store session in different process to run *.exe file
For more information: http://cstruter.com/blog/281

To launch external *.exe file, you need to use State Server session state mode.
StateServer mode, which stores session state in a separate process called the ASP.NET state service. This ensures that session state is preserved if the Web application is restarted.

You can store session in different process to run *.exe file
For more information: http://cstruter.com/blog/281

Thanks for the reply...but still i'm getting this following error.

Its showing me error in my configuration file. i.e sessionstate cookiesless="UseCookies" mode="SQLServer" sqlconnectionstring=myconnectionstring"/>

Thanks for the reply...but still i'm getting this following error.

Its showing me error in my configuration file. i.e sessionstate cookiesless="UseCookies" mode="SQLServer" sqlconnectionstring=myconnectionstring"/>

Try storing session in state service instead of SQL Server.

<sessionState mode="StateServer"
      stateConnectionString="tcpip=localhost:42424"
      cookieless="false"
      timeout="20"/>

Also, make sure "ASP.NET State Service" is in started(running) state.

Try storing session in state service instead of SQL Server.

<sessionState mode="StateServer"
      stateConnectionString="tcpip=localhost:42424"
      cookieless="false"
      timeout="20"/>

Also, make sure "ASP.NET State Service" is in started(running) state.

Thanks for your kind reply..
I made the above changes but still its not showing me exe files.

Thanks for your kind reply..
I made the above changes but still its not showing me exe files.

When you launch an *.exe file using below code in ASP.NET web application, application starts at server side not at client side. And you will see process running in task manager.

System.Diagnostics.Process MyProcess = new System.Diagnostics.Process();
MyProcess.StartInfo.CreateNoWindow = true;
MyProcess.StartInfo.UseShellExecute = true;
MyProcess.StartInfo.WorkingDirectory = "C:\\MyDirectory";
MyProcess.StartInfo.FileName = "MyApplication.exe";
MyProcess.StartInfo.Arguments = "MyArgument";
MyProcess.Start();

To run local *.exe on client side:
You can call any local *.exe from webpage(asp.net) using javascript because it always runs on client side.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.