├── todo.txt
├── .gitignore
├── Whut.AttachTo
├── Key.snk
├── preview.jpg
├── Resources
│ ├── Package.ico
│ └── Images_32bit.bmp
├── PkgCmdID.cs
├── Guids.cs
├── Properties
│ └── AssemblyInfo.cs
├── GeneralOptionsPage.cs
├── source.extension.vsixmanifest
├── AttachToPackage.cs
├── Resources.Designer.cs
├── Resources.resx
├── AttachTo.vsct
├── VSPackage.resx
└── Whut.AttachTo.csproj
├── README
├── ChangeLog
├── Whut.AttachTo.sln
└── license.txt
/todo.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/AttachTo/master/todo.txt
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /*.suo
2 | /*/*.csproj.user
3 | /*/bin/*
4 | /*/obj/*
5 | /*/StyleCop.cache
--------------------------------------------------------------------------------
/Whut.AttachTo/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/AttachTo/master/Whut.AttachTo/Key.snk
--------------------------------------------------------------------------------
/Whut.AttachTo/preview.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/AttachTo/master/Whut.AttachTo/preview.jpg
--------------------------------------------------------------------------------
/Whut.AttachTo/Resources/Package.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/AttachTo/master/Whut.AttachTo/Resources/Package.ico
--------------------------------------------------------------------------------
/Whut.AttachTo/Resources/Images_32bit.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/AttachTo/master/Whut.AttachTo/Resources/Images_32bit.bmp
--------------------------------------------------------------------------------
/Whut.AttachTo/PkgCmdID.cs:
--------------------------------------------------------------------------------
1 | // PkgCmdID.cs
2 | // MUST match PkgCmdID.h
3 |
4 | namespace Whut.AttachTo
5 | {
6 | public static class PkgCmdIDList
7 | {
8 | public const uint cmdidWhutAttachToIIS = 0x100;
9 |
10 | public const uint cmdidWhutAttachToIISExpress = 0x101;
11 |
12 | public const uint cmdidWhutAttachToNUnit = 0x102;
13 | }
14 | }
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | Adds "Attach to IIS", "Attach to IIS Express" and "Attach to NUnit" commands to Tools menu.
2 |
3 | Now you can start debugging web site hosted in local IIS server or failing NUnit test quicker than before:)
4 |
5 | AttachTo extension provides options to hide commands not relevant to you. You can also assign shortcut using Tools -> Options -> Keyboard.
6 |
7 | Visual Studio Gallery homepage: http://visualstudiogallery.msdn.microsoft.com/d0265ab0-df51-4100-8e10-1f84403c4cd0
--------------------------------------------------------------------------------
/Whut.AttachTo/Guids.cs:
--------------------------------------------------------------------------------
1 | // Guids.cs
2 | // MUST match guids.h
3 | using System;
4 |
5 | namespace Whut.AttachTo
6 | {
7 | public static class GuidList
8 | {
9 | public const string guidAttachToPkgString = "8d6080f0-7276-44d7-8dc4-6378fb6ce225";
10 |
11 | public const string guidAttachToCmdSetString = "16e2ac5c-ec3d-4ff1-a237-11ccef54fe0f";
12 |
13 | public static readonly Guid guidAttachToCmdSet = new Guid(guidAttachToCmdSetString);
14 | }
15 | }
--------------------------------------------------------------------------------
/ChangeLog:
--------------------------------------------------------------------------------
1 | AttachTo v1.0.1 - 2012-02-08
2 | - Fixed that show/hide menu commands where not applied immediately after Visual Studio restart
3 | - Added attaching also to nunit-console.exe process, and x86 counterparts of all NUnit processes
4 | - Added license terms to project
5 | - Added license terms, preview image and url to extension package
6 | - Added experimental support for Visual Studio 2011
7 |
8 | AttachTo v1.0.0 - 2011-11-06
9 | - Tools menu commands to attach to IIS, IIS Express and NUnit
10 | - Ability to show/hide the menu commands
11 |
--------------------------------------------------------------------------------
/Whut.AttachTo.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Whut.AttachTo", "Whut.AttachTo\Whut.AttachTo.csproj", "{557B4FF9-0BBA-4631-9101-FA5DF4D519A3}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {557B4FF9-0BBA-4631-9101-FA5DF4D519A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {557B4FF9-0BBA-4631-9101-FA5DF4D519A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {557B4FF9-0BBA-4631-9101-FA5DF4D519A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {557B4FF9-0BBA-4631-9101-FA5DF4D519A3}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2012 Whut, https://github.com/whut/AttachTo
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining
6 | a copy of this software and associated documentation files (the
7 | "Software"), to deal in the Software without restriction, including
8 | without limitation the rights to use, copy, modify, merge, publish,
9 | distribute, sublicense, and/or sell copies of the Software, and to
10 | permit persons to whom the Software is furnished to do so, subject to
11 | the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be
14 | included in all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/Whut.AttachTo/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Resources;
4 | using System.Runtime.InteropServices;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("AttachTo")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("Whut")]
13 | [assembly: AssemblyProduct("AttachTo")]
14 | [assembly: AssemblyCopyright("")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 | [assembly: CLSCompliant(false)]
19 | [assembly: NeutralResourcesLanguage("en-US")]
20 |
21 | // Version information for an assembly consists of the following four values:
22 | //
23 | // Major Version
24 | // Minor Version
25 | // Build Number
26 | // Revision
27 | //
28 | // You can specify all the values or you can default the Revision and Build Numbers
29 | // by using the '*' as shown below:
30 | [assembly: AssemblyVersion("1.0.1.0")]
31 | [assembly: AssemblyFileVersion("1.0.1.0")]
32 |
--------------------------------------------------------------------------------
/Whut.AttachTo/GeneralOptionsPage.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using Microsoft.VisualStudio.Shell;
3 |
4 | namespace Whut.AttachTo
5 | {
6 | public class GeneralOptionsPage : DialogPage
7 | {
8 | public GeneralOptionsPage()
9 | {
10 | this.ShowAttachToIIS = true;
11 | this.ShowAttachToIISExpress = true;
12 | this.ShowAttachToNUnit = true;
13 | }
14 |
15 | [Category("General")]
16 | [DisplayName("Show 'Attach to IIS' command")]
17 | [Description("Show 'Attach to IIS' command in Tools menu.")]
18 | [DefaultValue(true)]
19 | public bool ShowAttachToIIS { get; set; }
20 |
21 | [Category("General")]
22 | [DisplayName("Show 'Attach to IIS Express command")]
23 | [Description("Show 'Attach to IIS Express command in Tools menu.")]
24 | [DefaultValue(true)]
25 | public bool ShowAttachToIISExpress { get; set; }
26 |
27 | [Category("General")]
28 | [DisplayName("Show 'Attach to NUnit' command")]
29 | [Description("Show 'Attach to NUnit' command in Tools menu.")]
30 | [DefaultValue(true)]
31 | public bool ShowAttachToNUnit { get; set; }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Whut.AttachTo/source.extension.vsixmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | AttachTo
5 | Whut
6 | 1.0.1
7 | Adds "Attach to IIS/IIS Express/NUnit" commands to Tools menu. Every command can be hidden or assigned shortcut.
8 | 1033
9 | https://github.com/whut/AttachTo
10 | license.txt
11 | http://visualstudiogallery.msdn.microsoft.com/d0265ab0-df51-4100-8e10-1f84403c4cd0
12 | preview.jpg
13 | false
14 |
15 |
16 | Pro
17 |
18 |
19 | Pro
20 |
21 |
22 |
23 |
24 |
25 |
26 | Visual Studio MPF
27 |
28 |
29 |
30 | |%CurrentProject%;PkgdefProjectOutputGroup|
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Whut.AttachTo/AttachToPackage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.Design;
3 | using System.Linq;
4 | using System.Runtime.InteropServices;
5 | using EnvDTE;
6 | using Microsoft.VisualStudio;
7 | using Microsoft.VisualStudio.Shell;
8 |
9 | namespace Whut.AttachTo
10 | {
11 | //// This attribute tells the PkgDef creation utility (CreatePkgDef.exe) that this class is a package.
12 | [PackageRegistration(UseManagedResourcesOnly = true)]
13 | //// This attribute is used to register the informations needed to show the this package in the Help/About dialog of Visual Studio.
14 | [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
15 | //// This attribute is needed to let the shell know that this package exposes some menus.
16 | [ProvideMenuResource("Menus.ctmenu", 1)]
17 | [Guid(GuidList.guidAttachToPkgString)]
18 | [ProvideOptionPage(typeof(GeneralOptionsPage), "Whut.AttachTo", "General", 110, 120, false)]
19 | [ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExists_string)]
20 | [ProvideAutoLoad(VSConstants.UICONTEXT.NoSolution_string)]
21 | public sealed class AttachToPackage : Package
22 | {
23 | protected override void Initialize()
24 | {
25 | base.Initialize();
26 |
27 | OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
28 |
29 | this.AddAttachToCommand(mcs, PkgCmdIDList.cmdidWhutAttachToIIS, gop => gop.ShowAttachToIIS, "w3wp.exe");
30 | this.AddAttachToCommand(mcs, PkgCmdIDList.cmdidWhutAttachToIISExpress, gop => gop.ShowAttachToIISExpress, "iisexpress.exe");
31 | this.AddAttachToCommand(mcs, PkgCmdIDList.cmdidWhutAttachToNUnit, gop => gop.ShowAttachToNUnit, "nunit-agent.exe", "nunit.exe", "nunit-console.exe", "nunit-agent-x86.exe", "nunit-x86.exe", "nunit-console-x86.exe");
32 | }
33 |
34 | private void AddAttachToCommand(OleMenuCommandService mcs, uint commandId, Func isVisible, params string[] programsToAttach)
35 | {
36 | OleMenuCommand menuItemCommand = new OleMenuCommand(
37 | delegate(object sender, EventArgs e)
38 | {
39 | DTE dte = (DTE)this.GetService(typeof(DTE));
40 | foreach (Process process in dte.Debugger.LocalProcesses)
41 | {
42 | if (programsToAttach.Any(p => process.Name.EndsWith(p)))
43 | {
44 | process.Attach();
45 | }
46 | }
47 | },
48 | new CommandID(GuidList.guidAttachToCmdSet, (int)commandId));
49 | menuItemCommand.BeforeQueryStatus += (s, e) => menuItemCommand.Visible = isVisible((GeneralOptionsPage)this.GetDialogPage(typeof(GeneralOptionsPage)));
50 | mcs.AddCommand(menuItemCommand);
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Whut.AttachTo/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:2.0.50727.42
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Whut.AttachTo {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Whut.AttachTo.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/Whut.AttachTo/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 | text/microsoft-resx
119 |
120 |
121 | 2.0
122 |
123 |
124 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
125 |
126 |
127 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
128 |
129 |
--------------------------------------------------------------------------------
/Whut.AttachTo/AttachTo.vsct:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
29 |
36 |
37 |
41 |
42 |
45 |
46 |
47 |
48 |
50 |
51 |
58 |
67 |
68 |
77 |
78 |
87 |
88 |
89 |
90 |
91 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/Whut.AttachTo/VSPackage.resx:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 | text/microsoft-resx
120 |
121 |
122 | 2.0
123 |
124 |
125 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
126 |
127 |
128 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
129 |
130 |
131 |
132 | AttachTo
133 |
134 |
135 | Adds "Attach to IIS" and "Attach to NUnit" Tools menu commands.
136 |
137 |
138 | Resources\Package.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
139 |
140 |
--------------------------------------------------------------------------------
/Whut.AttachTo/Whut.AttachTo.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 2.0
7 | {557B4FF9-0BBA-4631-9101-FA5DF4D519A3}
8 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
9 | Library
10 | Properties
11 | Whut.AttachTo
12 | AttachTo
13 | True
14 | Key.snk
15 | v4.0
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 | true
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | false
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | {80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}
59 | 8
60 | 0
61 | 0
62 | primary
63 | False
64 | False
65 |
66 |
67 | {26AD1324-4B7C-44BC-84F8-B86AED45729F}
68 | 10
69 | 0
70 | 0
71 | primary
72 | False
73 | False
74 |
75 |
76 | {1A31287A-4D7D-413E-8E32-3B374931BD89}
77 | 8
78 | 0
79 | 0
80 | primary
81 | False
82 | False
83 |
84 |
85 | {2CE2370E-D744-4936-A090-3FFFE667B0E1}
86 | 9
87 | 0
88 | 0
89 | primary
90 | False
91 | False
92 |
93 |
94 | {1CBA492E-7263-47BB-87FE-639000619B15}
95 | 8
96 | 0
97 | 0
98 | primary
99 | False
100 | False
101 |
102 |
103 | {00020430-0000-0000-C000-000000000046}
104 | 2
105 | 0
106 | 0
107 | primary
108 | False
109 | False
110 |
111 |
112 |
113 |
114 | Component
115 |
116 |
117 |
118 | True
119 | True
120 | Resources.resx
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 | ResXFileCodeGenerator
129 | Resources.Designer.cs
130 | Designer
131 |
132 |
133 | true
134 | VSPackage
135 |
136 |
137 |
138 |
139 | Designer
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 | Menus.ctmenu
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 | license.txt
157 | Always
158 | true
159 |
160 |
161 | true
162 | Always
163 |
164 |
165 |
166 | true
167 |
168 |
169 |
170 |
177 |
178 | Program
179 | <_VisualStudioInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\InstallDir)
180 | $(_VisualStudioInstallDir)devenv.exe
181 | /rootsuffix Exp
182 |
183 |
--------------------------------------------------------------------------------