Open-source release: VS code segment shortcuts and quick deployment tools for visual debugging, open-source
Preface:
A long time ago, I sent two articles about the custom code version and visual debugging:
1: Visual Studio tips: custom code snippets
2: Custom visual debugging tool (Microsoft. VisualStudio. DebuggerVisualizers)
Two graphs can be used for representation:
1: custom code snippet:
2: Visual debugging tool:
Source:
One time, I found that my visual debugging class library was a little old and I wanted to update it, but I found that:
VS2005, VS2008, and Vs2012 versions of VS are installed on the computer. It is annoying to open the path, copy and paste it everywhere.
Testing, code modification, re-coding, and repeat the above things are all the more annoying.
When I think that I am so tired of updating, I 'd like to spend some time writing a program to simplify these operations!
Solution:
Write a program and double-click it to automatically process it to simplify the operation.
Program code:
At the beginning, I also planned to scan the Registry to find the path. Later I found that installing VS was still under the central rule, so I used a simpler method:
1 static void Main (string [] args) 2 {3 try 4 {5 string runPath = AppDomain. currentDomain. baseDirectory; 6 List <string> cd = new List <string> (); 7 cd. add ("C: \ Program Files"); 8 cd. add ("D: \ Program Files"); 9 cd. add ("E: \ Program Files"); 10 cd. add ("F: \ Program Files"); 11 cd. add ("G: \ Program Files"); 12 cd. add ("H: \ Program Files"); 13 14 cd. add ("C: \ Program Files (x86)"); 15 cd. add ("D :\\ Program Files (X86) "); 16 cd. add ("E: \ Program Files (x86)"); 17 cd. add ("F: \ Program Files (x86)"); 18 cd. add ("G: \ Program Files (x86)"); 19 cd. add ("H: \ Program Files (x86)"); 20 Dictionary <string, string> dic = new Dictionary <string, string> (); 21 dic. add ("2005", "\ Microsoft Visual Studio 8"); 22 dic. add ("2008", "\ Microsoft Visual Studio 9"); 23 dic. add ("2010", "\ Microsoft Visual Studio 10.0"); 24 dic. add ("2012", "\ M Icrosoft Visual Studio 11.0 "); 25 dic. add ("2013", "\ Microsoft Visual Studio 12.0"); 26 dic. add ("2015", "\ Microsoft Visual Studio 14 "); 27 // read VS installation path 28 string vPath = "\ Common7 \ Packages \ Debugger \ Visualizers "; 29 string mPath = "\ VC # \ Snippets \ 2052 \ Visual C #"; 30 foreach (string item in cd) 31 {32 foreach (KeyValuePair <string, string> kv in dic) 33 {34 string vFolder = item + kv. value + vPath; 35 I F (Directory. exists (vFolder) 36 {37 string dll = runPath + kv. key + "\ CYQ. visualizer. dll "; 38 if (File. exists (dll) 39 {40 File. copy (dll, vFolder + "\ CYQ. visualizer. dll ", true); 41 Console. writeLine ("To:" + vFolder + "\ CYQ. visualizer. dll "); 42} 43} 44 string mFoler = item + kv. value + mPath; 45 if (Directory. exists (mFoler) & Directory. exists (runPath + "\ snippet") 46 {47 string [] files = Directory. GetFiles (runPath + "\ snippet ","*. snippet "); 48 foreach (string file in files) 49 {50 File. copy (file, mFoler + "\" + Path. getFileName (file), true); 51 Console. writeLine ("To:" + mFoler + "\" + Path. getFileName (file); 52} 53} 54} 55} 56 Console. writeLine ("Completed! "); 57} 58 catch (Exception err) 59 {60 Console. WriteLine (err. Message); 61} 62 Console. Read (); 63}
Download source code:
SVN address acquisition: http://code.taobao.org/svn/cyqopen/trunk/CYQ.Visualizer/
Microsoft. VisualStudio. DebuggerVisualizers. dll
Here, thank you:
Effect display:
After running:
Then we can see the effect happily in:
1: custom code disconnection:
2. Visualization
Summary:
Finally, you can get thin in various VS environments: one-time writing and running experience everywhere!