Rapid development of Visual Studio and introduction of Visual Studio 2010 new features
- 2020-05-16 06:44:25
- OfStack
1. Quick command:
2. Integrated development environment (IDE)
Support multi-window monitoring
4. web. config
5.IntelliTrace debugging (I think this function is very powerful, when debugging a long statement before, 1 accidentally skipped F5, had to run again once, to see the process of the value, vs2010 added this function, you can see the process of the value of each execution, very convenient! Very powerful)
6. Release and deployment (the release and deployment of vs2010 are a little more complicated than before, and I have been struggling with this release for a long time.)
7. Shortcuts
8. Replace Ctrl+F in other editors for easy incremental search
9. Open IDE's navigation with Ctrl+Tab to get a bird's eye view
10. Find a matching tag
11. Delete redundant using instructions and sort them
12. Insert the code block twice by pressing "tab"
13.1 some shortcuts
14. Refactoring (rename, extract method, encapsulate field)
15. A bookmark
16. Customize the font of the current edit form (although this function is easy to use, it can only be applied for this time. After closing vs, open it again to restore the default Settings)
Visual Studio 2010 new features, the current edit form holding Ctrl, scrolling the mouse pulley, adjust the font size at will, this effect only applies to the current form, and the project re-open to restore the default font
To conclude, there is more to discuss!
"devenv" Start the corresponding version Visual Studio
"Inetmgr" IIS Manager, do not have to go to the management to find, soon can be displayed IIS Management of the
2. Integrated development environment (IDE)
vs2010 the IDE It has been redesigned to improve readability. To reduce clutter, unnecessary lines and gradients have been removed
The installation Visual Studio After the first 1 The secondary load requires the selection of the default integrated development environment ( IDE ), according to the project selection, 1 A selected Visual C# The development,
If you want to reset during development IDE , you can select the menu bar tools - "import and export Settings wizard -" reset all options -" 1 Step -- select the set you want to reset
Support multi-window monitoring
Multi-window monitoring is supported and the code editor can be dragged out IDE So that you can view it side by side with the design view window, press and hold Ctrl Double-click the navigation form,
The window will float out and dock again Ctrl key Hold to navigation.
4. web. config
web.config: The configuration file
Web.config Files usually include Settings that must differ depending on the environment in which the application is running
vs2010 By default Visual Studio 2008 There will be two more files , They are :
Web.Debug.config and Web.Release.config As the name implies , According to their names, I can infer that they are respectively used in [ debugging ] model , and [ issue ] In mode web.config The replacement !
5.IntelliTrace debugging (I think this function is very powerful, when debugging a long statement before, 1 accidentally skipped F5, had to run again once, to see the process of the value, vs2010 added this function, you can see the process of the value of each execution, very convenient! Very powerful)
When you debug, IntelliTrace Data about the managed application is collected behind the scenes, including from many framework components
(e.g. ADO.NET , ASP.NET and System.XML ). these IntelliTrace Events enable developers to see what happened previously during execution, and most importantly,
The ability to "backtrack" to see the previous state of the application without having to restart the debugger. When I went into the debugger, I immediately saw the previous collections listed in order IntelliTrace The event,
IntelliTrace The window allows you to filter the list of collected events by category or by thread. In addition, I can perform a text-based search to find important events to jump to quickly.
Due to the IntelliTrace Exceptions are also collected, so I can search for the term "exception," and the list is filtered to list the causes ASP.NET An exception to the error page, including the exception thrown in it
Bring up the IntelliTrace Window shortcut Ctrl+D . V
6. Release and deployment (the release and deployment of vs2010 are a little more complicated than before, and I have been struggling with this release for a long time.)
1. Specify the files and IIS Settings, there are a lot of options that need to be checked, you can refer to more MSDN The explanation is very clear
2. It needs to be released first iis Click on the new virtual directory and then the website / Applications and services URL All of them correspond to the virtual directory asp.net Version needs to be changed to 4.0 .
The following errors occurred after release and deployment and the modified schema:
Browse the page after publication if a compilation error occurs CS0016: Failed to write to output file" c:\Windows\Microsoft.NET\Framework\...... App_global.asax.noqfk5qp.dll " -- "Access denied ,
Then it might be due to the system directory Temp The directory has no corresponding permissions caused by will C : \\windows\temp the network_service Just give the appropriate permissions
7. Shortcuts
On the back 1 Key combinations for cursor positions Ctrl + - Key said Navigate BackWard, Using key combinations Ctrl + Shift + - Key said Forward
If you want to copy 1 Line of code, you just need a simple press CTRL+c Copy and press CTRL+v Paste this line instead of selecting the entire line. If you want to delete 1 Line of code, just press CTRL+x It is ok
To define F12
Go to the current row Ctrl+G
8. Replace Ctrl+F in other editors for easy incremental search
According to the Ctrl+I Key;
Type the text you want to search for. Note: you will see the cursor jump to no 1 Where the matching text is highlighted;
Once again, press the Ctrl+I Key, the cursor will jump down 1 Matching text;
According to the Ctrl+Shift+I Can search backwards;
To stop the search, press ESC key
9. Open IDE's navigation with Ctrl+Tab to get a bird's eye view
According to the "Ctrl+Tab" Key, open the IDE Navigation window, press and hold Ctrl Key, at the same time with the direction key or mouse selected 1 To activate a file or tool form.
Note: it is best not to loosen it at this time "Ctrl+Tab" , press the direction key to see the aerial view, after all release to locate the required file or tool window
10. Find a matching tag
Certain signs always come in pairs. For example, "{" The identifier must be corresponding "}" The logo is off.
Although you click 1 a { It matches it } It will be highlighted, but it will be hard to find if the code is too long. Again,
Compiler indicator "#region" There has to be a counterpart "#endregion" Indicator. When navigating through your code, you sometimes need to look for the appropriate identifier. By pressing the Ctrl+] You can do that.
This shortcut key is only used when the cursor is in any of these identifiers 1 It immediately jumps to the corresponding identifier regardless of whether it is open or closed.
If you want to highlight all the code between two matching identifiers, press Ctrl+Shift+] Highlight the entire block and move the cursor to the open marker.
This shortcut will only work if the cursor is below an arbitrary identifier (it will not work if the cursor is in the area)
11. Delete redundant using instructions and sort them
new 1 When it comes to classes, Visual Studio Common namespaces will be used using At the head of the class. But before we finish 1 When it comes to classes,
There are some using It's redundant. Delete the redundant using And row 1 The following order makes the code look clearer. Visual Studio This has been done for us 1 Cut. Right click in the code editor,
You can see " organization using" Menu, that's all we need
12. Insert the code block twice by pressing "tab"
Enter code snippets in the edit, for example "for" In this state, press it twice "tab" Key, will insert the block of code , At this point you can put the first 1"i" To" index" And then press Tab Key, then all variables become" index" .
Note: it is fast and easy to make grammatical mistakes.
13.1 some shortcuts
How do I use the shortcut keys to insert above or below the current line of code 1 Ok (recommended, very practical)
Press the Ctrl+Enter I'm going to insert it up here 1 A blank line
Press the Ctrl+Shift+Enter I'm going to insert it down here 1 A blank line. The cursor will Move to the beginning of the new row
Sort code Ctrl+k,D , the code messy, looks like a lot of effort, you can try this shortcut, very good!
Formatted text Ctrl+E,D Format the code
annotation Ctrl+E,C Comment lines
uncomment Ctrl+E,U Uncomment line
Quickly hides or displays the current code segment Ctrl+M,M
14. Refactoring (rename, extract method, encapsulate field)
If you want to rename a method during development, select the method name and right-click on the refactoring rename ,(Ctrl+R,R), You can preview the changes referenced by the method, query the changes in the comments, and make sure the changes are clean wherever the method is called
Extraction method ( Ctrl+R, M ) : if the method is too long and it is difficult to browse the code segment, the relatively independent code segment can be extracted. 1 The aspect code is clearly visible when viewed, another 1 Aspect can also achieve the effect of code reuse
Encapsulate field ( Ctrl+R . E ) : 1 General entity classes will have private variables, public properties, when written 1 After some private variables, select the right variable refactoring Encapsulate the field, enter the reconstructed property name,
although 1 General entity classes are generated by the code generator, but there is no way to avoid adding modifications, so it is easier and less error-prone
15. A bookmark
with vb6.0 Developers are definitely used to using bookmarks to locate things, visual studio In the bookmark 1 Some shortcuts: code editing area, bookmarks are displayed in menu items
Toggle labels in the current line, Ctrl+B . T
Move first 1 A label, Ctrl+B . P
Move to the next 1 A label, Ctrl+B . N
You can also move the location code up and down the current document in the current folder
16. Customize the font of the current edit form (although this function is easy to use, it can only be applied for this time. After closing vs, open it again to restore the default Settings)
Visual Studio 2010 new features, the current edit form holding Ctrl, scrolling the mouse pulley, adjust the font size at will, this effect only applies to the current form, and the project re-open to restore the default font
To conclude, there is more to discuss!