简体   繁体   中英

How do I setup IIS when debugging in Visual Studio 2010?

In Visual Studio 2010 I have created a WebService (WCF) Application and a client to consume said service.

My 3 options as far as what servers to use for debugging are: Visual Studio Development Server, Local IIS Web Server, Custom Web Server.

I know I can't use the VS Development Server if I want my service to be accessible outside of localhost. So I installed IIS (Control Panel>Add/Remove Programs>Add/Remove Features). When I select this option in Visual Studio 2010 it doesn't seem to work. I'm not sure what options I have to setup so that other machines can run the client to consume this service.

By default VS set the Project URL to: http://localhost/MyService . Oh, and I'm working with .svc files (not .asmx) if that makes any difference.

Common problem when you intall IIS after the framework.

Go to your Windows\\Ms.Net\\Framework\\<version> folder and execute aspnet_regiis.exe . It's a commandline tool.

To save having to install IIS you can configure a proxy - such as Fiddler - to redirect certain incoming traffic to localhost.

Because these new requests are "appearing" (via the redirect) from inside your machine, Cassini will respond.

The process is covered in this answer: https://stackoverflow.com/a/4428747/1016183 under "Option #2: Write a FiddlerScript rule"

You can right click on Project and do publish. This will generate the required files for your deploy.

In order to debug your app, you can use the Visual Studio built-in host or IIS. In your project properties, under Web, you can select "Use Local IIS Server".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM