I'm trying to create a webapplication for my local network.
I've installed IIS 8 on a PC and I'm hosting an ASP.NET C# application on it.
Now I would like to launch an exe-file on the server, when the user clicks a button in the asp.net application.
I've created a new application pool for the webapplication.
Now I'm launching the exe with the following code:
Process process = new Process();
process.StartInfo.FileName = #"C:\Windows\notepad.exe";
process.Start();
If I check the task manager, I can see that the exe is running in the background.
Unfortunately, it doesn't show up on the desktop.
Obviously, there is a problem with permissions for the IIS service.
Can you help me with the configuration of the permissions?
Thank you,
Sandro
This is no longer possible in Windows Vista/Windows Server 2008 or later. To help prevent what are called 'shatter' attacks - where an attacking program sends a message to a privileged service's window, that exploits a vulnerability in that message handler - the 'interactive' session is isolated from real desktops. Microsoft call this Session 0 Isolation. There are some application compatibility measures for legacy services.
On Windows Server 2003 and earlier, it will only work if the user is either logged on at the physical console, or using a special switch to Remote Desktop to tell it to connect you to an administrative session. For Remote Desktop 6.0 or before (before XP SP3 or Vista SP1) you use the /console switch. For Remote Desktop 6.1 or later (included in XP SP3 and Vista SP1), use /admin. Other remote access utilities project the physical console session.
Related
We deploy our .NET applications (.NET-Framework 4.5.2 and upwards) on a network drive. To explain, we build it in Visual Studio and copy the contents of bin/release. Several users who are connected to different terminal servers of Windows Server 2012 R2, Windows Server 2016 or Windows Server 2019 via RDP run the application. Most of the time it works great, but from time to time the application stops working. Either it doesn't start at all or it crashes at a specific action. The action at which it crashes is always different. After we close the application for all users on the terminal server, it works again without any problems. It looks like all users share the same process and if one crashes, it crashes for everyone.
Is this a known problem and do you have any solutions? For easy and fast update reasons, we cannot install the application directly on the server.
I have a WCF (C#) installed on a server that execute xxx.exe file.
The xxx.exe using c++ CreateWindow and write txt file.
I already find a lot of solution ...
How to execute exe form asp.net ?
Unable to Start a Process from ASP.NET
I can start a process from ASP.NET using System.Diagonistics.Process.Start method. Process start in the background ,but I can't see it in the desktop.
I can't find iis admin service and "Allow Service to Interact with Desktop check box" in the services.
Server:
Windows 7 64bit
Internet Information Services 7
.NET Framework 4.5
WCF:
using System.Diagnostics;
Process.Start(#"D:\xxx.exe", "");
local services:
go to start, in the search box type "local services", open that program and find IIS Admin Service, click Log On tab there is a radio button group called Log on As and a check box "Allow service to interact with desktop"
You may have to restart service and IIS.
EDIT:
If you can't see the Admin Service in local service, then you will have to enable it in Windows Features under Internet Information Services -> Web Management Tools -> IIS6 Management Compatibility -> Check All
EDIT
Try with processinfo
ProcessStartInfo startInfo = new ProcessStartInfo(#"D:\xxx.exe");
startInfo.WindowStyle = ProcessWindowStyle.Normal;
Process.Start(startInfo);
I have an unlimited Windows Hosting package on a Windows Server 2012. I wish to run a game server of some game which can run on windows hosts by executing an EXE file (that opens a Console, CMD-like window) - that means, if you want to run a server on your local computer you can simply run this application and use your internet's IP. I want to use my web address as an IP but however my question is: Can a Windows Server (2012) execute files?
Yes. With many *BUT*s and *IF*s. First of all nearly all hosting packages differs for purposes. If your hosting not game hosting hosting firm will not allow you using their processing power.
What would be the best (or easiest) way to setup a development environment in order to:
- develop iOS(iphone) application using Xcode in a MAC
- iphone app will be calling .NET web services written in C# (windows laptop)
- the database is MS SQLServer 2008 R2 (windows laptop)
I understand that I could do all this in my MAC if I was using PHP/MySQL but I really need the C#/MS SQL combo.
Thanks in advance.
Ceta
If you don't have access to a dedicated Windows environment for development, I would suggest that you install VMWare Fusion or Parallels on your Mac, and do your Windows development in a VM.
Can you not just deploy the Webservices (on the web?) and just test your API calls remotely?
Alternatively, network the machines so you can access the development copy, or use something like Parallels Desktop to run Windows inside your Mac environment. Related: Visual Studio on a Mac
If you have both machines up and running, XCODE, VS and SQL Server already installed, then I don't see the problem.
You only need to configure the special things in your Windows Machine so its perfectly suited for Web Services development. Skip the steps you may already have done.
1) Install IIS 6 / 7 (depends on your windows version)
2) Install ASP.NET
3) Turn off your firewall for Home network, or configure some permission for allowing inbound traffic to the HTTP/HTTPS ports.
4) Make sure you have an static IP address in your home network, or, make sure your machine name is DNS resolvable from your Mac.
You need IIS because Visual Studio internal web server doesn't allow remote connections.
Now, how can you debug your C# code if the Web Service is running in IIS? two options:
1) (easy) In the solution explorer, right click on your web project, choose properties, chose Web, in the section named "Servers" choose use local IIS WebServer and name your virtual folder. You'll be able to debug easily.
2) (medium) You can just publish your web app to your local IIS, make it run, and then from visual studio using the debug -> attach to process menu attach yourself to the w3wp.exe. The problem is, if you have several application pools, have fun finding your application.
I am using VS2008 C# and testing on my local XP Pro PC with local IIS, I have wrote a web service to call a third party software .exe file to use svn checkout commands to insert data into a folder, which use System.Diagnostics.Process.Start . The same codes did work when I use VS2008 build-in ASP.NET Development Server(http://localhost:2999/MyServices/MyServices.asmx). but when I use IIS normal URL(http://developer/MyServices/MyServices.asmx) to run Process.Start on the web service, it just haunlted and not doing anything.plz send one sample program.
This is most likely down to the user being used to run the code. When using the built-in server, it is running as the same user as Visual Studio is running as. When in IIS, it will be running as the MACHINENAME\ASPNET user.
If the process you are starting cannot execute as the MACHINENAME\ASPNET user, it will not work when hosted in IIS unless you change your configuration to change the user it runs as. See this page for more info on what users are used for what in IIS.