Prevent unnecessary apps from running in visual studio 2017 - visual-studio

I have 4 runnable projects(specifically web apps) in a single solution. The problem is when i try to run visual studio all the above mentioned apps getting run in background, but not in browser. However the setup is such that only one app is meant to run. Startup Project is set as Single startup project only

Right click on Solution.
Select Properties.
Select a single Startup Project

I fixed this by doing the below steps in Visual Studio
Select the project you want to stop running in background
press F4 (this will open properties of the project, but not the property page opens by right click > property)
Set Always Start When Debugging to false
But remember this is a user to user configuration. You cannot set it for all your team members

Related

Cannot change thread mode after it is set

I have a C# app that I haven't worked on for a while. The last time I worked on this was with Visual Studio 2019. It still opens and runs in debug mode with VS 2019. IF OI open it with VS2022 it will not run in debug mode. I get and error:
Cannot change thread mode after it is set.
What causes this and what might the solution be?
Please follow the steps below:
Go to project properties by right-clicking your project name in the project explorer and choosing properties
In the project properties window, select Build on the left side of the list
On the right side make sure you uncheck "Prefer 32-bit"
Save the project
Debug and test your project. This should resolve the issue.
Screenshot of Project Properties

Make Visual Studio 2019 Always Run as Administrator from Start Bar Recent Solutions List

I recently upgraded to Windows 10 and Visual Studio 2019.
Prior to the upgrade, Visual Studio 2017 would always run as Administrator. I did not think much of this, but now that it is gone it is causing me problems.
The primary one is that it will not load my projects that use my local instance of IIS.
I usually launch Visual Studio from my start bar. Right now this goes like this:
Right click on the icon on the start bar and select my solution.
It loads and then I realize that the main project did not load.
Close visual studio, open as admin
Pick my solution and then it loads.
I would really like to only have to do #1 above. Is there someway I can edit the shortcut on the start bar to have it always launch as Administrator?
Turns out that Visual Studio uses different permissions when you click on the list of shortcut options it offers in the start menu. (IE to load a recent solution directly.)
Selecting the Properties->Advanced->"Run as Administrator" did not cause these to run as administrator.
But this did it:
Find devenv.exe (Visual Studio's executable)
Right Click on it and select "Troubleshoot Compatibility".
On the Program Compatibility Troubleshooter window, click on Troubleshoot Program
Check that the program requires additional permissions and click Next
On the next window, click on Test the program… and VS will open as administrator
Click next and then click on Yes, save these settings for this program
Now Visual Studio will ALWAYS run as administrator.
(Taken from: https://ppolyzos.com/2017/08/08/always-run-visual-studio-as-administrator/)

Can't see emulator selection option in visual studio 2012 for windows phone

In my Visual studio 2012 for windows phone , I created one project and I developed some pages.
It is working fine and i'm able to debug by selecting the desired emulator option.
Suddenly the device options tab is not visible. It is looking like below.
For testing purpose I've opened another project, then for this project i'm getting the emulator option. It is looking like this.
I didn't understand why it is happening with the first project. could you please tell me how to enable emulator options for the first project.
Thanks.
If you have multiple projects in your solution then the one that is set as the 'StartUp project' is probably not a Windows Phone app.
The options included in the menu relate to the startup project only.
To change the startup project, right click on the project in the solution explorer and select "Set as StartUp project".

Starting multiple projects when debugging in Visual Studio 2010

In Visual Studio 2010, I have a web application and a console application (actually a service using NServiceBus, but it runs locally as a console application) that I want to both startup when I hit Debug.
Right now I have the Web Application set as the startup application and it opens in a browser, then I right click on my Service and go to Debug -> Start new instance. This works fine, but I would rather not do it manually because I sometimes forget and need the Service running to handle messages from the website.
Thanks.
You can start multiple projects by choosing multiple projects to start and the order by right clicking on the solution node on the solution explorer and selecting Properties from the menu. Select the radio button for "Multiple startup projects" and choose the action as Start for the required projects.

Why does Visual Studio launch multiple WebDevs when I debug?

I have a Visual Studio 2008 solution with several projects in it - some of which are web applications / sites.
Whenever I go "Debug > Start new instance" for a specific web application and VS launches the ASP.net Development Server (WebDev.WebServer.EXE) for that application, VS also launches 3 additional such processes - one for each of 3 other web applications I have in the solution.
How can I tell Visual Studio to only launch WebDev for the one project I'm debugging? I've looked both in the project configurations and in the solution configuration and could not find the relevant setting...
I think it runs one for each Port -- you can try turning setting them to have the same port - click on the project and look at the properties pane (you have to turn off the the automatic port generation and then set the port#)
I tried the above solution but it did not worked. My solution was a vs2005, what I found to solve the project was to make the property window of VS 2008 visible. Then click on the web projects and then set the "Always start when debugging" property to false and this should take care of it :(
In Visual Studio 2008, there is an entry on the Properties page for the project called "Always Start When Debugging".
Note you have to get to this by selecting the project and going to the Properties pane (or right-clicking Properties). This option is not present when you double-click the project and open it in the main editing pane.
VS by default sets this value to on for all your web projects. Turning it off will solve this problem.
[editorial]This is fairly annoying and I wish the default were false![/editorial]
Suggestion - don't use the internal WebDev, use IIS instead. Also reduces the clutter in the systray. ;)

Resources