Visual Studio rapid development and introduction to Visual Studio 2010 new Features _ Basic application

Source: Internet
Author: User
Tags visual studio 2010
1. Quick command:
Copy Code code as follows:

"Devenv" launches the appropriate version of Visual Studio
"Inetmgr" IIS Manager, no need to go to the management to find, you will soon be able to display the IIS management

2. Integrated development Environment (IDE)
Copy Code code as follows:

The IDE for VS2010 has been redesigned to improve accessibility. Unnecessary rows and gradients have been removed to reduce clutter
The first load after installing visual Studio requires you to select the Default integrated development environment (IDE), and, depending on your project, you typically choose Visual C # Development,
If you want to reset the IDE during development, you can choose the menu bar tool--the Import and Export Settings Wizard--Reset all options--Next--"Select the collection you want to reset

3 Support for multi-window monitoring
Copy Code code as follows:

Supports multiple window monitoring, you can drag the code editor out of the IDE so that you can view it side-by-side with the Design view window, and hold down the CTRL key to double-click the navigation form.
A floating form appears, docked and hold down the CTRL key to the navigation.

4.web.config
Copy Code code as follows:

Web.config: Configuration file
Web.config files typically include settings that must be different depending on the operating environment of the application
VS2010 By default, there are two more files than Visual Studio 2008, which are:
Web.Debug.config and Web.Release.config, as the name suggests, I can infer from their naming that they are used for web.config replacements in debug mode and release mode respectively!

5.IntelliTrace Debugging (I think this function is very powerful, before debugging very long sentence, accidentally F5 skipped, had to rerun, to see the value of the process, vs2010 new Add this function, you can see the value of each execution in the process, very convenient! Very strong)
Copy Code code as follows:

When you are debugging, IntelliTrace collects data about managed applications in the background, including from many framework components
(such as Ado.net, ASP.net, and System.Xml) information. These IntelliTrace events enable developers to view what happened earlier in the process and, most importantly,
The ability to "backtrack" to view the previous state of the application without restarting the debugger. When I entered the debugger, I immediately saw the previously collected IntelliTrace events listed sequentially,
The IntelliTrace window allows you to filter the list of collected events by category or by thread. In addition, I can perform text-based searches to find important events that can be quickly jumped to.
Because IntelliTrace also collects exceptions, I can search for the term "exception" and the list will filter to list the exception that caused the ASP.net error page, including both the exception that was thrown in it
Pull up the IntelliTrace window shortcut key ctrl+d,v

6. Release, Deployment (VS2010 release and deployment personally feel more complicated than before, on this release I've been tossing it for a long time before I get it done)
Copy Code code as follows:

1. Specify the files and IIS settings to be deployed, which are many of the options that need to be checked, more to refer to MSDN, explained very clearly
2. When you publish, you need to create a new virtual directory under IIS, and then the site/application and service URLs correspond, and the asp.net version of the virtual directory needs to be changed to 4.0.

The following errors occurred after publishing and deployment, and the schema was modified:
Browse the page after publishing if there is a compilation error CS0016: Failed to write to output file "C:\Windows\Microsoft.NET\Framework\ ... App_global.asax.noqfk5qp.dll "--" Deny access,
This may be due to the system directory of the TEMP directory does not have the appropriate permissions, the C:\\windows\temp network_service to the appropriate permissions can be

7. Shortcut keys
Copy Code code as follows:

Return to the previous cursor position, with the combination of CTRL +-key to represent navigate backward, using the key combination CTRL + Shift +-key to represent Forward
If you want to copy a line of code, you simply press CTRL + C to copy it, and then press CTRL + V to paste the line, without having to select the entire line of code. If you want to delete a line of code, just press ctrl+x.

Go To Definition F12
Go to Current line ctrl+g

8. Convenient incremental check to replace ctrl+f in other editors
Copy Code code as follows:

Press Ctrl+i Key;
Type the text you want to search for. Note: At this point you will see the cursor jump to the first match where the matching text is highlighted;
Press the Ctrl+i key again and the cursor will jump to the next matching text;
Press Ctrl+shift+i to search backwards;
To stop the search, press the ESC key

9. Use Ctrl+tab to open the IDE's navigation and get a bird's eye view
Copy Code code as follows:

Press the Ctrl+tab key to open the IDE navigation window, hold down the CTRL key, and use the arrow keys or mouse to select a file or tool form to activate.
Note: At this time, it is best not to release the "Ctrl+tab", according to the arrow keys to see the aerial view, all released after the location to the required file or tool form

10. Find a matching tag
Copy Code code as follows:

Some identities always appear in pairs. For example, the "{" Identity must be closed with the corresponding "}" identity.
Although you click on a {and it matches the} will be highlighted, but if the code is too long to find a bad, the same,
The compiler indicator "#region" must have a corresponding "#endregion" designator. When navigating your code, you sometimes need to find the corresponding identity. By pressing CTRL +] You can do this.
This shortcut only works when the cursor is below either of these identifiers, and it immediately jumps to the corresponding identifier regardless of whether it is an open or closed identity.
If you want to highlight all of the code between two matching identities, press ctrl+shift+ to highlight the entire block and move the cursor to the Open tab.
This shortcut key works only if the cursor is below an arbitrary identity (such as the cursor does not work in the region)

11. Remove redundant using directives, and sort
Copy Code code as follows:

When you create a new class, Visual Studio uses the common namespaces using the header of the class. But when we finish writing a class,
Some of the using is redundant, remove the redundant using, and then arrange the order to make the code look clearer. Visual Studio has done all this for us. Right-click in the code editing area,
You can see the "Organize using" menu, and that's what we need.


12. Insert code block by pressing "tab" two times
Copy Code code as follows:

Enter the code fragment in the edit, for example "for" in this state, press two times "tab" key, will insert the code block, at this time you can change the first "I" to "index", and then press the TAB key, then all the variables have become "index".
Remark: This is fast and not easy to make grammatical mistakes.

13. Some shortcut keys
Copy Code code as follows:

How to insert a row above or below the current line of code by using a shortcut key (recommended, useful)
Press Ctrl+enter to insert a blank line above
Pressing Ctrl+shift+enter inserts a blank line below. The cursor moves to the beginning of the new line
Tidy code CTRL+K,D, code messy, look very laborious, you can try this shortcut, very good!
Format Text ctrl+e,d the code
Comment Ctrl+e,c Comment Line
Uncomment Ctrl+e,u Uncomment line
Quickly hide or display the current code snippet Ctrl+m,m

14. Refactoring (renaming, extracting methods, encapsulating fields)
Copy Code code as follows:

In the development process, if you want to rename the method, you can select the method name to refactor  rename, (ctrl+r,r), you can preview the method to modify the reference, comment on the query modification, to ensure that this method by the call can be modified clean
Extraction method (Ctrl+r, M): If the method is too long, the browsing Code section is very laborious, can be more independent of the code snippet extraction, on the one hand, the code to browse up clearly visible, on the other hand can achieve the effect of code reuse
Encapsulate Field (CTRL+R,E): The general entity class will have a private variable, public property, when a private variable is written, the selected variable right key  refactoring  encapsulate the field, enter the refactoring property name,
Although the general entity classes are generated by the code generator, but also can not avoid the addition of modifications and other operations, so this is more convenient and error-prone


15. Bookmark
Copy Code code as follows:

vb6.0 developed with a certain habit of using bookmarks to locate shortcuts to bookmarks in Visual Studio: Code editing area, bookmarks in menu item display
Toggles the label on the current line, ctrl+b,t
Move to previous label, Ctrl+b,p
Move to the next tab, Ctrl+b,n
In addition, in the current folder, the current document moves up and down the positioning code

16. Customize the font for the current edit form (this feature works, but only applies to this time, turn off vs, turn on Restore defaults again)

Visual Studio 2010 has new features, the current editing window, hold down CTRL, scroll the mouse wheel, adjust the font size at will, this effect applies only to the current form, and the item is reopened to restore the default font

  Summing up to this, there are more to be discussed!
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.