To automatically set new items as startup projects in Visual Studio

Source: Internet
Author: User

There are no new items that are frequently added when you work on a project, so when you need to switch the startup project in Visual Studio, manually right-click in the project and select Set as Startup Project.
In progress. NET basic knowledge management often need to create a new project to explain, each time a new project wrote code and then click to run only found that the previous startup project, but also manually right click on the new project, select "Set as Startup Project", very troublesome. Check the VS option to find a way to set it up:
Select main menu → tools → options → projects and solutions → build and run, select Use currently selected project for new solution as Startup Project

Before that, I thought that there was no such feature in Visual Studio, so I wrote a addins to implement this feature, though it didn't make much sense, but I shared the core code and wanted to help people who needed it:
In the OnConnection of addins:
_applicationobject.events.solutionevents.projectadded + = new _dispsolutionevents_projectaddedeventhandler ( solutionevents_projectadded);

Solutionevents_projectadded Method Implementation:
void solutionevents_projectadded (Project project)
{
Automatically set up a new project when it is added as a startup item
Envdte.solutionclass sol = (envdte.solutionclass) _applicationobject.dte.solution;
Sol. Solutionbuild.startupprojects = new object[] {project.uniquename};
Microsoft.VisualBasic.Information.TypeName (obj);
}

such as Peng Net. NET training courses are registered, there is a network of places can participate in such as Peng Network of learning, after learning can be high-paying employment, click here to understand

Three years ago, as long as the "three-tier architecture" can be said "proficient in layered architecture"; Now you need to understand the IOC (AUTOFAC, etc.), Codefirst, lambda, DTO, etc. only valuable;

Three years ago, as long as SQL Server can say that they are "proficient in database development", now need to master MySQL and other open source database to say yes. NET open source "era of programmers;

Three years ago, as long as the user upload content security processing can be, now need to be familiar with cloud storage, CDN, etc. to be in the cloud computing era;

Three years ago, as long as master Lucene.Net will say that they are "familiar with the site search engine development"; now everyone uses elasticsearch, you still use lucene.net is too corny;

Three years ago to send mail or use smtpclient; now do a large web site to send mail must use the cloud mail engine;

Three years ago the cache is Context.cache, and now is the world of Redis and memcached;

such as Peng Net again lead. NET community technology trend. Click here to learn about such as Peng Network. NET Latest Courses

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.