0

I have a vs solution with 2 projects - WinForms client, and WCF Service. Since visual studio 2013 to 2019 (I was under Windows 7), every time when I ran in debug the WinForm client, VS automatically was starting the IISExpress in background(I want that!), and my calls from the client were successful, stopping on breakpoints inside the WCF service easy.

Last week, I got new box with Windows 10. Now when I start the client, there is no iisexpress. The source code is the same and not changed - my co-workers are under Windows 7 and this works for them - same code - we use git as version control.

The only time I see iisexpress is if I do "Update Service Reference" or I make the WCF startup project and run it.

Can you help me identify why this functionality stopped working? Ideas for a fix?

Windows 10, Visual Studio 2019 Enterprise, .NET 4.6

EDIT: I do not have problem running the webservice in IISExpress, when i specifically run it - it works, also on solution level if I set 2 startup projects, all will work. The main issue is that with Single Startup project - thw WinForms client, Visual Studio will not bring up the IISExpress instance. It is only development time issue, and this works for my co-workers.

Nik Todorov
  • 758
  • 1
  • 6
  • 17
  • Does this answer your question? [Cannot run web application on Windows 10 using IIS Express](https://stackoverflow.com/questions/31959548/cannot-run-web-application-on-windows-10-using-iis-express) – rene Dec 03 '19 at 08:00
  • Nop. see my EDIT paragraph. – Nik Todorov Dec 04 '19 at 19:23

2 Answers2

2

The solution is in the VS generated (regenerated if missing) user file in the WCF project .csproj.user there is property

<AlwaysStartWebServerOnDebug>True</AlwaysStartWebServerOnDebug>

It must be True, but now it is defaulted to False. The *.user files do not go to version control, and if they are missing VS regenerates them, hence my coworkers had it, and my freshly cloned repo did not.

I'm pretty sure I never touched this file or did any configs like that on the WCF project, my suspicion is that MS decided to start defaulting to False in some version or patch.

WARNING! After changing the option, close/open the entire solution or restart VS.

Disclaimer: I found this solution in the build in VS report problem button leading to a portal with reported problems and solutions. I do not see how to copy link or anything from that Feedback tool, but this is the guy that deserves the credit: 佐々木隆幸

Nik Todorov
  • 758
  • 1
  • 6
  • 17
0

It seems that you want to debug the WinForms application separately regardless of the WCF application. we could set up the project dependencies in the property page of the VS solution.
enter image description here
Then open the SVC file, press F5 to launch the WCF application so that we can add service reference in WinForms application.
enter image description here
Please ensure the below configuration in the property page of the WCF application project.
enter image description here
Besides, if there is something wrong with the IISExpress, we could opt to repair the IISExpress in the below dialog.
enter image description here
On my side, it works like a charm.
enter image description here
Feel free to let me know if the problem still exists.

Abraham Qian
  • 7,117
  • 1
  • 8
  • 22
  • Now if you stop your service, and make the WinForms project default and hit F5 you will see the running windows forms app, but do you see the IISExpress started automatically? As i said this solution is configured and working properly for the last 3 years. Only on my windows 10 box does not start the IIS authomaticaly. I can start it as in your example, but thats not the issue... BTW thanks for trying to help appreciated. – Nik Todorov Dec 04 '19 at 18:28