How to make process start when running in IIS - asp.net

When I add the site to run in IIS, my process.start() does not work to open the process. It only runs locally. Is there a way to make that method also work in IIS?

Related

Publish ASP.NET web app project without debug=true needed

I have a web app project and when running long tasks while debugging it works well. When I publish it, it just times out. We found out that if we set the tag debug=true, it works again (production server). Of course, it's not permitted to leave it like that. What could I do about this?

How to debug two web site projects that are in different solutions?

I have a solution A with a web site project that it needs to call another web site project B that is in another solution. I mean different visual studio instances
I don't know how to attach them to debug them at the same time like in a single trace.
Does anyone knows how can i do that?
Thanks
You can do this using two running Visual Studios:
You set up one of the projects in IIS and the other you can run out of Visual Studio directly then you can debug in both.
On the first project (the one running in IIS) you can 'Attach to a process' and attach to the w3wp worker process. See this:
Attach Debugger to IIS instance
Then in the second project just run the project using Debug --> Start Debugging option from the VS menu.
Optionally you can run them both out of IIS and attach to both processes.
Make sure you have debug allowed in your web.config files.
What i can think of is, you can deploy project B with pdb file onto a server and attach remote debugger to that server.

Shell.Invoke doesn't launch the powershell script in deployed asp.net web application

I wrote an asp.net web application, which launches a powershell script. The program ran without any issue when I debugged it in my development environment. After publishing and deploying the asp.net web application (by the way the target server is the same machine localhost), by clicking the button for launching the powershell script, nothing happened. It means the powershell script was not launched. I attached the debugger to the deployed asp.net and saw that the Shell.Invoke() was hit as before and the command was also correct. However Shell.Invoke() returned immediately and the powershell script was not launched. In my environment the powershell execution policy is RemoteSigned.
Since the program in the development environment works perfectly and in the deployed case also hits the same code, I don't think it has to do with the code but more with security, certification,...???
Has anyone experienced the same? If yes, please advise me what I should do.
I appreciate your help in advance.
Thx
Might have something to do with the application pool identity not having the right permissions:
You might want to run your PowerShell invocation from a system service with explicit permissions though. That will take a steeper curve though.

call asp.net webservice on localhost

I have been given a task where I have to write some code for an ASP.NET website that also uses a webservice.
The webservice works fine on the webserver, but when i run in debug mode in Visual Studio, I get an access not allowed when calling one of the methods (ip 127.0.0.1).
I need to run in debug mode to look at what the code does...
What to do from here ?
Do I need to do some changes in the host file.
Do I need to install IIS on my PC instead of using the VS local webserver (cassini)
Cassini web server does not allow remote connections. You could use Fiddler to forward traffic on localhost to another port on the same machine for some given requests.
By far the easiest solution is to install IIS on your local machine and run it from there.
Cassini is fine for development and getting something running up very quickl.
But never us it to test things that will go into production on a "real" IIS.
Yes, Microsoft says its completely the same, but running on your localmachine also IIS gives you exactly the same environment as you will have on any live hosting environment.
Sure, its a little bit more work, but developing this way reduces errors and artefacts which may steal you some time.

Invoke an application using webservice

I'm trying to write a web service on my server windows server2008 to invoke some applications on my server. I user system.diagnostics.process class to invoke exe files. It works fine on server itself, but when i use the webservice over a different pc, I got error message which is specified file not found. But when I just launch cmd.exe it works fine too. As far as i understand I have access to server which i can run at least cmd.exe on. But when it comes to invoke different exe's it just doesn't work. I have another clue too, when I run the cmd.exe remotely it runs, and I try to kill it remotely then it gives me the error "Access denied".
I'm not familiar with this kind of server access,permission jobs. Hence I need some help.
Any help would be appreciated :)
You need to make sure that the Application Pool in IIS in running as a user that has permission to execute the executables on that server.
Just a word of warning (as you may know): this is a huge security risk if you expose these services out to anywhere. Opening up a service to run an application can be risky so I would make sure that there's no other way to do what you're trying to accomplish.

Resources