连接到w3wp.exe文件Visual Studio的键盘快捷键宏
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了连接到w3wp.exe文件Visual Studio的键盘快捷键宏相关的知识,希望对你有一定的参考价值。
Tools > Macro IDE > Add new item to MyMacros > Select Module, Name 'AttachToWebServer' > Copy/paste code.To set as a keyboard shortcut go to Tools > Options > Keyboard, and search for the name of the macro (AttachToWebServer) and then assign a keyboard shortcut.
Imports System Imports EnvDTE80 Imports System.Diagnostics Public Module AttachToWebServer Public Sub AttachToWebServer() Dim AspNetWp As String = "aspnet_wp.exe" Dim W3WP As String = "w3wp.exe" If Not (AttachToProcess(AspNetWp)) Then If Not AttachToProcess(W3WP) Then System.Windows.Forms.MessageBox.Show(String.Format("Process {0} or {1} Cannot Be Found", AspNetWp, W3WP), "Attach To Web Server Macro") End If End If End Sub Public Function AttachToProcess(ByVal ProcessName As String) As Boolean Dim Processes As EnvDTE.Processes = DTE.Debugger.LocalProcesses Dim Process As EnvDTE.Process Dim ProcessFound As Boolean = False For Each Process In Processes If (Process.Name.Substring(Process.Name.LastIndexOf("") + 1) = ProcessName) Then Process.Attach() ProcessFound = True End If Next AttachToProcess = ProcessFound End Function End Module
以上是关于连接到w3wp.exe文件Visual Studio的键盘快捷键宏的主要内容,如果未能解决你的问题,请参考以下文章
如何连接到 SQL Server Compact 3.5 文件作为 Visual Studio 2012 中的数据源?
EntityFramework 连接到 Visual Studio SQL Server (localdb)
无法在 Visual Studio 2019 C# 中连接到 Oracle 数据库
手动将 MS Access 数据库连接到 Visual Studio