How to select which solution to "run" in multi-solution project - visual-studio

I am an electronic engineer with limited experience in Visual Studio. I have created a project with 2 solutions. The idea is that the 2nd project will allow to me do some tests more easily.
Now when I click on "build" or "start debuging" or "start without debugging", how do I choose which project should be is targetted by the tool?

Right click the project in the Solution Explorer pane, and select Set as Startup Project.

Related

VS 2022 .NET 6.0 "Always start when Debugging"

I have an netstandard2.1 Project in my Solution that always starts even when I start debugging another project. I can enable this in Properties in the Solution explorer.
Now I added a .NET 6.0 project to the solution and I want the same behaviour. But I don't know where to enable this feature.
How can I activate the feature?
If I understand correctly you are looking for VS feature multiple startup projects.
To select multiple projects as startup you can right-click on the solution item in the solution explorer, select "Properties" and then under "Common Properties" -> "Startup Project" click on "Multiple startup projects" and select needed ones:

How to add a pre-build step to project via the Visual Studio IDE

Is there an easy way to add a pre-build/post-build step to a project via the Visual Studio IDE? I know I can edit the .csproj/.*proj file - what I want to know is if there is a way right from the IDE.
You can right-clic on the project name in the solution explorer and clic on "properties" in the popup menu. In the window that shows up, go to the section "configuration properties / Buid events" (or something similar: my IDE is in french). You will then have the choice:
Pre-build events,
Pre-link events,
Post-build events.

Visual Studio 2013 Preview: No Publish To File System?

So I've built my project and I want to use the VS2008/2010/2012 "Publish To File System" option in Visual Studio 2013 Preview to push my project to a staging server for testing... but I can't find it anywhere in any of the menus.
It's bad enough that they've randomly rearranged the menu structures and items for TFS, but this change basically makes it impossible for me to recommend 2013 to anyone, much less the CTO, as an upgrade path.
This can be accomplished easily:
Right click on project in Solution Explorer
Click Publish
Under Profile select <New Custom Profile...>
Create profile name (can be anything, dev.domainname.com)
Under Connection > Publish Method > select File System
Enter the Target location \\server\sharedfolder\
The rest of the settings are common as they were in the past.
The next time you go to publish just select the profile and you are done.
With two other people looking over my shoulder and making random suggestions, we finally stumlbed across the answer. It turns out that VS2013 requires you to create a New Profile for each and every publish you make for each and every project in your solution. Hmm. :-\
FYI, running Visual Studio 2013 Update 5 the publish web dialog looks a bit different, screenshot below:
Choose "Custom"
Give the profile a name and hit OK.
Select "File system" as the preferred publishing method...
The first time in to VS 2013 you will not have a "New Profile" option as described by KeyOfJ.
This worked:
Right click on project in Solution Explorer
Click “Publish”. A “Publish Web” dialog box pops up.
Under tab “Profile”, in “Select a publish target”, select “Custom”. A “New Custom Profile” box pops up
Enter a “Profile name” and click “OK”
In tab “Connection” under “Publish Method”, choose “File System”
In tab “Connection” enter a “Target location”. Click “Next”
Under “Settings”, click on “File Publish Options”. Click “Next”
Click “Publish”
Next time you want to publish this project, VS. 2013 will default to the Profile name you just entered, and you will be able to publish in one click.
Can you find Team Explorer? View -> Team Explorer.
Click Commits, and you can see "Publish to Remote Repository". Type in TFS URL or other Git repo to upload your project.
You can create a fake web connection and then reenter data, selecting Local File System.

How do you have multiple startup projects in VS2010?

Looking through the achievement list for Visual Studio 2010, it says that there is an achievement for having 3 startup projects.
How do you have multiple startup projects at once? Whenever I right click a project and select "Set as StartUp Project" it switches my current startup project to the new one. I wasn't aware multiple startup projects was even a possibility.
How to: Set Multiple Startup Projects:
Visual Studio allows you to specify how more than one project is run when you start the debugger.
To set multiple startup projects
In Solution Explorer, select the solution.
On the Project menu, click Properties. The Solution Property Pages Dialog Box opens.
Expand the Common Properties node, and click Startup Project.
Click Multiple Startup Projects and set the project actions. For more information, see Startup Project, Common Properties, Solution Property Pages Dialog Box.

Why doesn't F5 rebuild project before execution in Visual Studio?

If I press F5, my project runs but it doesn't "see" any of the changes that I made. I need to manually (re)build before pressing F5 for it to work.
It worked well previously. Any idea what I need to change?
Also :
Right Click on the solution in the solution explorer.
Click on "Properties".
Navigate to configuration Properties -> Configuration on the left side of the window.
Make sur the "Build" checkbox is checked on the line of your project.
Is it possible that you've reconfigured your "Build and Run" settings to "Never build"?
To check, follow these steps:
From the Visual Studio IDE, open the "Tools" menu, and click "Options".
Expand the "Projects and Solutions" header on the left.
Click the "Build and Run" item.
In the combo box labeled "On Run, when projects are out of date", ensure that you have the "Always build" option selected.
Another reason (which I had) could be dependencies.
In Solution Explorer, right click the Startup Project - Build Dependencies - Project Dependencies.
If the project you are working on is not set as a dependency of the Startup project then it won't get Built when you F5 / run.
Ok, for some reason all of the above solutions do not work for me, so I made a Pre-Build event (Right click project -> Properties -> Build Events) where I delete the bin and obj folder before building.
I am new to C# and Visual Studio but i found that going to Build -> Clean Project also worked for me, if you have already tried to select "Always build" option and it didn't work.

Resources