ASP.NET Web API 2 continues to start even though it is not the startup project in VS 2017 - asp.net-web-api2

In my solution, I have two projects: an WPF application and an ASP.NET Web API 2 created using the defaults. Under the API Properties - Web tab, I'm using IIS Express.
On the Solution Property Pages, I have Single startup project checked, with the WPF project selected. I can confirm this is the startup project because the WPF application is bolded in Solution Explorer. I've verified none of the IIS Express sites are running in the task tray.
When I hit F5, both the WPF and the Web API start running.
Is there a setting I'm missing somewhere? Why is the Web API starting despite not being the startup project?

In Visual Studio 2017, navigate to View > Properties Window. Then click the Web API project name in Solution Explorer, and set the Properties window's Always Start When Debugging option to False.

Related

Running winforms client, does not start iisexpress with the referenced wcf service - under Windows 10. Ideas?

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.
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: 佐々木隆幸
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.
Then open the SVC file, press F5 to launch the WCF application so that we can add service reference in WinForms application.
Please ensure the below configuration in the property page of the WCF application project.
Besides, if there is something wrong with the IISExpress, we could opt to repair the IISExpress in the below dialog.
On my side, it works like a charm.
Feel free to let me know if the problem still exists.

Run on IIS without publishing (point IIS to project folder)

I have a .NET Core 3.0 Razor pages project. Is it possible for it to run in the local IIS express WITHOUT publishing?
For debugging in IIS without publishing, you could follow steps below:
Run VS as administrator
Open your Razor page project
Right-Click project->properties->Debug tab
New profile->IIS
Launch-> IIS
Enter configuration you need for other fields
Run with F5

Added WCF Service Reference. But where is Reference.svcmap and Reference.cs?

I am accessing a WCF service from a client. The client is configured properly to access the proxy. However, I am expecting to find 2 files (reference.svcmap, reference.cs) under the SERVICE REFERENCES folder in Visual Studio 2012. Instead, I can only see a localhost (this refers to the namespace of the client proxy created).
From where do I see reference.svcmap and reference.cs?
You need to highlight the project (ClientIndigo) in the solution explorer, and then click on the Show All Files button in the toolbar at the top of Solution Explorer.
In Visual Studio 2010, this looked like this (haven't upgraded to VS2012 myself):
Those files are "nested" below the service reference, and not shown by default.

How can I stop VS2010 from lauching the wcf host when it's not needed?

I imported a vs2008 solution containing a class library with a wcf service defined in it. The solution also contains a console project which holds the hosting app for the service. The console app is set as the startup project. When I hit Debug, the console app tries to open the service host, but vs2010 also launches the generic WcfHost. This causes console app to crash.
How do I stop the WcfHost from launching and competing with the console app that hosts the services too?
or should I stop the console app from hosting?
Not exactly sure about VS2010, but in VS2008, right-click the class library project w/ the WCF service in the Solution Explorer and select Properties. You should see a WCF Options tab. That tab has a checkbox that, to the best of my recollection, is checked by default. I have long since unchecked it, but it controls the startup of the WcfHost. Again, I'm not sure about VS2010, but I would look for a project property setting that controls this.

wcf : Service + Client in same solution, how to debug? I don't want to run 2 versions of VS 2010 at the same time

I have created an application which has a client (WPF) and the Server (WCF), the service is IIS hosted, currently I am having to have 2 versions of vs 2010. One loads the wcf service in IIS and the other in my windows application.
The problem with this is it takes so much resources.
It appears if the wcf service is "NOT" hosted in IIS then I can start two projects at the same time according to this http://msdn.microsoft.com/en-us/library/bb157685.aspx
But what are my other options?
I need to find the best way of being able to compile / run the 2 projects and able STEP INTO each when when in debug, without using too many resources or having more than one vs 2010 open at the same time.
You should be able to debug both from the same instance of Visual Studio if they are in the same solution. When you run your application from Visual Studio, open the Debug menu and choose Attach To Process, you need to attach the debugger to the ASP.NET worker process (aspnet_wp.exe), it should automatically attach to your client.
Open service and client code in VS. Open Debug menu. Attach to process. Hold the Ctrl key and select as many processes as you want to debug using Mouse click.
In your case, you can select the ASP NET worker process depending on the version of IIS and the client process.
The easiest way to debug your WCF service is to:
Right click on project containing svc file.
Select Set as Startup project.
Put a breakpoint on the methods you want to debug.
Breakpoint should be Red.
Make sure your app config file is pointing to the debug WCF service version that's currently running, ex:
http://localhost:12345/MyService.svc
Run your app.
When the app calls that WCF method, it should stop on breakpoint.