I wanted to start IIS Express with the configuration I wanted on boot. The best way to do this was the start it via a Service. I first tested it using a console application in VS 2013 (C#) by starting IIS Express as a process and killing it on exit. This worked fine.
However when I made it into a service, the service installed fine, and it started automatically but it refused to start IIS Express. I had to stop the service, go to the property of the service I installed and change the Log on option to “This account” enter my username and password, click OK, and start the service. This started the IIS Express and my webserver worked fine from that point onwards.
I have a two part question:
Is there something about IIS Express that I need to know which is stopping me from starting it from service?
What can I do to start it automatically either programmatically or during the Service installation process (serviceprocessinstaller properties perhaps)?
Thanks in advance :)
Related
I am trying to setup some web applications to run locally on IIS 7. I have gone through everything on
https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k(vs.debug.error.http);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5)&rd=true
Many other posts mention also doing
aspnet__regiis.exe -i
Which I have done several times.
In the IIS manager I can see my site, I can start the app pool find (as well as recycle and stop), but whenever I go to localhost I get a 503. If I try to run the debugger the app pool just dies. One site mentioned that having Visual Studio installed first can cause problems so I uninstalled that and re-installed but that was ineffective (it's also installed/uninstalled through a company web store so I don't know how "clean" it gets after the install).
I've tried manually creating the site, etc in IIS Manager still with no results
Under the Add or Remove Windows Features in Programs I have enabled everything under IIS as well so everything should be installed
Hi I have developed a C# Windows Service in Visual Studio.
I am able to install this service on my local machine and it works fine.
Now I want to be able to install it on a remote server.
Can you tell me how to do this?
My service is just built on the Windows Service VS template, so it's all very simple.
I am not so geeky, so it would be useful with some tutorial, manual which I can understand.
I am running VS 2010 Professional.
You need to have Remote Desktop access to the server.
When you are in you can do it via the commandline using something like this:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\installutil /LogToConsole=true C:\Path\To\Service.exe
Then you can manage it (start it, set it to auto start, stop it, restart it) by going to Start | Run and typing
services.msc
then press enter.
To uninstall it use:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\installutil /u /LogToConsole=true C:\Path\To\Service.exe
But you will need to have stopped the service first.
Note: There is probably a new util in newer .net releases - my notes are from a while ago when I built a 2.0 service. Look in C:\Windows\Microsoft.NET\Framework\ for a version number that matches the .net you're developing in.
Use the SC command.
sc \\remotecomputer create newservice binpath= C:\Windows\System32\Newserv.exe
start= auto obj= DOMAIN\username password= pwd
I am building a .NET 4.0 Web Forms application in C#. After working for around 4-5 months on this application, the other day when I went to 'Start' the application from Visual Studio 2010 and the application does not want to start. When trying to connect using telnet on the local host and that port, it connects, and after a while I get an error '400 - Bad Request'.
The funny thing is that when I Publish the application on another IIS server, it works fine, it seems like the problem is from the asp.NET Development Server. While I know that I can set-up a local IIS, I would prefer not to avoid doing this in order to avoid certain problems which might be related to having a different configuration of the local IIS from production.
I have checked the hosts file, re-installed visual studio and confirmed that the application works when published. I have also checked that the port is not being used by another process.
What else should I check?
If the application will not start, then the odds of you being able to connect to it via telnet on a port are 0. (It's not running.)
I am assuming the application can compile if you can publish it. Have you tried running the application without debugging? CTRL + F5
How can I run my application on another machine, my team member wants to view the webpage in his computer. He doesn’t want to install visual studio but just wants to see the webpage in the browser.
I am using a Mac book
Publish it to a web server, or have him install IIS on his machine and set it up.. wait. That would be publishing to a web server.
In short, an ASP.NET website needs a web server to run. Usually it's IIS, but if you have Visual Studio, it uses the built-in Cassini web server. Either way, you need to have it in a web server of some kind. You can't just run it as a stand-alone program.
I haven't' done this, but I think you COULD have it running in your computer in Visual Studio and still have him see it. If you run it, you'll see that the address is in the format:
http://localhost/:[some port number]/YourWebAppName
If you have it running in Visual Studio on YOUR machine, your team member MAY be able to access it by changing "localhost" to your PC name. It's worth a shot.
Otherwise, here are a bunch of links to how to publish your site, in case you're not sure.
http://www.google.com/search?q=publishing+asp.net+web+sites&sourceid=ie7&rls=com.microsoft:en-us:IE-Address&ie=&oe=
Create a new virtual directory in IIS
Set the directory root to your project root folder.
allow anonymous access.
Your team member can then access it at http://yourmachinename/virtualdirectoryname
This looks like a good job for IIS express http://learn.iis.net/page.aspx/868/iis-express-overview/
For the majority of things, it's functionally equivilent to using regular IIS 7.5, with the exception that it's easier to start new websites with this. You simply use the command line to start IIS Express, point it to your physical path, set the CLR version, and the port, done!
http://learn.iis.net/page.aspx/870/running-iis-express-from-the-command-line/
There's some instructions for how to do that.
I have a web service project and simple test application. I can debug the web service from Visual Studio 2008. However, there exist a real client application, but it is on another machine. ASP.NET Development Server does not allow connections if they are not from localhost, or so it seems. Is there a way to debug a web service, if client application is on another machine?
Edit
The tool that I used is Trace Utility from Microsoft SOAP Toolkit. Further explanation can be found here (works on XP; see continuation story for Windows 7 solution). There was problem with it though. My remote client fetches the WSDL first, and then creates URL based on values in soap tags found at the end of WSDL. So client gets redirected to localhost, which is not good.
I found my problem though, but I'll leave the question open until I find the time to try debugging via IIS.
Install a virtual directory into the IIS on your local machine. If you don't have IIS, install it. Once IIS is installed and configured on your local machine, you should be able to use either the IP or create a dns alias for that IP to access the web service that way.
I'm using SoapUI basic version to fake the SOAP requests to the web service, which is running in debug mode in Visual Studio, from the local computer.
You can use IIS (or Cassini Web server) - for debugging, attach VS 2008 to correct process (for example w3p.exe(IIS6 or greater) or aspnet_wp.exe(IIS 5)).