简体   繁体   中英

F5 works, CTRL + F5 doesnt…?

I have a simple solution with a windows client and a website. The website exposes a web service that the windows client consumes. So far so good. Here's the weird part. When running my solution in VS, the call to the web service doesn't work when I hit CTRL F5 unless I run it with a simple F5 first. So each time I open the solution in a new VS session, I have to run it in debug ( F5 ) at least once before it works without debugging ( CTRL F5 ).

This makes no sense to me. Has anyone else run into an issue like this? Any ideas would be greatly appreciated!

Thanks!

Ian

For your webservice (which i assume is in its own project), do you have it set to use the local Web Development Server or IIS? This can be found in the project properties.

It sounds like you are using a Web Development Server (called Casini) and that does not start up until you run it with debug. Does a little icon appear in the system tray when you do that? It should. That shows that a webserver is now running and the webservice can be accessed by your client app.

The client app project is probably set as you startup project. You can also set the solution to have multiple startup projects. By doing this, you ensure that both projects start when debugging (which is what you want in your example). You can set this by right clicking o the solution, go to properties, and then to Common Properties - Startup Project. In there, choose "multiple startup proejcts" radio button and select both projects to start. This will also ensure that Visual studio attaches to both running processes which is required for debugging.

The instructions assume you are using VS2008. Hope this helps!

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