Visual Studio 2008 Extensibility Development (V): Manipulating solution, Project, and ProjectItem

Source: Internet
Author: User
Tags object model

Objective

To be honest, the previous essays would be tedious to read, and more so. But the fun is always behind me, and from this I'll show you how it's much more interesting to manipulate the elements of VS in add-in.

Most of the time, we develop in VS, starting with the solution open, then finding the project, opening the file for development. This article describes the content associated with this.

Introduction to Solutions, projects, and items

I believe that these three are to us. NET developers are more familiar. But their representation in AOM (the Automation object model) is not the same as we would have imagined. Look at figure 1 below, where the main elements are solutions, solution Folders, projects, folders, files. AOM represents the solution through the solution interface; The project interface represents the solution folder and project, and the ProjectItem interface represents the folders and files. I'll introduce them with an example below.

Simple Code Generators

In the actual development, we often need to adopt some specific technical solutions, which determine the overall structure of the program, manifested in the program is a number of projects, assemblies, configuration files of the organization. There was a time when you liked Ibatis.net, and here's a demo of its example project Npetshop. The basic structure of the npetshop is as follows:

Diagram 1:npetshop Program Structure

Its code can be found in the Npetshop source for. NET 2.0 article. External-bin inside is the required various assemblies, domain is the entity class, persistence is the data access layer, service is the business logic layer, presentation is the performance logic layer, the Web is responsible for the final performance. If you were to develop this solution, it would take us some time to build the framework for the entire solution at the beginning of the project. Through add-in, we can do "one time to write, multiple use."

Now let's look at how to create a solution from scratch. In this case, the approximate process is:

Figure 2: Solution creation Process

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.