0

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.

2
Contributors
9
Replies
12
Views
5 Years
Discussion Span
Last Post by riteshbest
0

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

Edited by riteshbest: space alignment

0

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

0

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".

0

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".

0

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

0

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"/>

0

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.

Edited by riteshbest: Added code tag

0

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.

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.