Automate "Attach to Process" in Visual Studio 2012 [duplicate] - visual-studio-2012

This question already has answers here:
Visual Studio - Attach to process shortcut
(12 answers)
Closed 6 years ago.
I am developing a .NET DLL for software which is not part of my solution (don't have source).
I'd really like to somehow implement a key shortcut that automatically attaches the DLL to a specific executable (ideally waiting for the exe to start).
What is the best way to go about this?
If there's a way to leave VisualBasic out of the picture that would be an extra bonus.
(No offense to VB fans but I just don't like it)

Since macros don't exist in Visual Studio 2012, you will need to add an extension.
AttachTo is very good and lightweight. Search for it in Extensions and Updates (in Tools) in Visual Studio.
Adds "Attach to IIS", "Attach to IIS Express" and "Attach to NUnit" commands to Tools menu.
Now you can start debugging web site hosted in local IIS server or failing NUnit test quicker than before:)
AttachTo extension provides options to hide commands not relevant to you. You can also assign shortcut using Tools -> Options -> Keyboard.

Related

When we compare local version with server version in Visual Studio, how to make the local version editable?

I found that sometimes when I use "compare" in Visual Studio, I couldn't edit the local version at all. But sometimes it does allow this. Is there any setting in TFS that is related to this functionality?
The steps I followed:
Right clicked the file in Solution Explorer I want to compare, and chose "Compare", with the dialog window popped out like this:
and cliked "OK"
I found several questions similar to my question, but amazingly all of them don't have even a relevant answer:
Visual Studio Diff Tool - When is Editing Allowed?
Under what conditions will the Visual Studio 2012 Difference Viewer allowing editing a source file

Visual Studio regularly freezes running Microsoft.VisualStudio.Web.Host.exe

Background
I maintain several web sites that are Visual Studio "Web Site Projects".
Problem
I've found that with a couple of these projects, Visual Studio regularly freezes while I'm working on the code. This doesn't happen for some of the web site projects, and I haven't seen it happen on any Web Application projects.
Symptoms
Each time it freezes, it takes about half a minute before I can use it again.
During a freeze, Windows Task Manager reports that Microsoft.VisualStudio.Web.Host.exe is maxing out one of the CPU cores.
Steps to Reproduce
Open a .cs file under the App_Code directory.
Make a change to the file.
Save the file.
Navigate somewhere else (eg switch tab, close the file, open different program in Windows).
Navigate back to the file (eg switch tab to it, open it, or go back to Visual Studio).
Other actions that sometimes seem to trigger the problem:
"Go to definition"
Opening a file
Previewing a file
Closing a file
Using a refactoring
"Find usages"
What I've Tried
Both Visual Studio 2012 and Visual Studio 2015
Changing the website project's build action
Disabling "Build Web site as part of solution"
Deleting web references and the Bin folder seems to minimise the problem, but obviously this breaks the web site. Maybe web site projects experience this problem when they contain a lot of C# code other than code-behind files?
Similar problems
I found the following potentially-related problems using Google, but none of them seemed to contain a workaround or solution.
Microsoft.VisualStudio.Web.Host.exe Time Theft
Microsoft.VisualStudio.Web.Host.exe
Visual Studio 2012 freezes for approximately 30 seconds after every build
I noticed that the problem happened less often when I suspended ReSharper.
The problem still happened occasionally when editing classes under App_Code, but restarting Visual Studio worked around it.
I was facing a similar problem. A single Web application project with dozens of class libraries, migrated over from VS 2010 into VS 2013.
I was able to solve my problem by disabling the "Hosting Process" option:
To disable the hosting process
Open an executable project in Visual Studio. Projects that do not
produce executables (for example, class library or service projects)
do not have this option.
On the Project menu, click Properties.
Click the Debug tab.
Clear the Enable the Visual Studio hosting process check box.
Full details on MSDN: http://msdn.microsoft.com/en-us/library/ms185330.aspx
Another option for people experiencing this on old web applications that don't have the properties page in the accepted answer above.
Disable "Allow this precompiled site to be updatable".
Open Site/Solution
Right click and view Property Pages
Go to MSBuild Options
Uncheck "Allow this precompiled site to be updatable"
This worked for me.
This problem stopped happening when the Web Site project was converted into a Web Application project.
Not an easy solution, but it did stop the problem.
They symptoms in the question of this post sound exactly like the nightmares I just had today:
Other actions that sometimes seem to trigger the problem:
"Go to definition"
Opening a file
Previewing a file
Closing a file
Using a refactoring "Find usages"
Plus intellisense wasn't working (even with CTRL + J) and
'Peek definition' was hanging as well.
I had to keep task killing visual studio (both 2015 and 2017).
My fix was to go into the project that I was having problems with, open the 'Package Manager Console' and uninstall and re-install the 'DotNetCompilerPlatform'
uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
and then
install-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
So far every problem I was encountering has not resurfaced (but this was just today so still need to give it time).
UPDATE:
It started creeping back again. I noticed also that whomever had installed to the solution had only done it to two of the various projects. Uninstalling the compiler platform (which means using the compilers that came with Visual Studio) has made life sane again.

Sublime TFS Settings

When working with Classic ASP, Sublime is AWESOME, but what has been stopping me so far is the fact that at work we use Visual Studio Team Services (previously Team Foundation Service) to Check-out / Check-in files we edit and work on and that goes rather well with Visual Studio 2012 that we use. But VS is so slow compared to Sublime especially when all I care about is editing text.
Today I found out that Sublime Text (I use Version 3) has a plugin for TFS! So I installed it (also installed the TFS Power Tools 2012). But now I'm confused as I can not see any visual clues to my files like I do with Visual Studio 2012, so I don't know what files are up to date, and what files need checking in ... etc.
After reading the official page of the Sublime TFS plugin. I understand that I need to set tf_path somewhere! The page though doesn't say where and in what format :( I am lost.
Where do I set the tf_path and in what format?
Any help would be great, Thank You.
Navigate to Preferences -> Package Settings -> Sublime TFS and open both Settings - Default and Settings - User (which will be an empty file). Copy the entire contents of the default settings file to the user file, then change any paths to reflect your personal setup. Save the user file (you are not allowed to modify the default file, just close it), restart Sublime for good luck, and you should be all set.
If you want your Sublime Text changes to be seen in Visual Studio Team Explorer, then you can change your Workspace to a local one.
For more information: https://www.visualstudio.com/en-us/docs/tfvc/decide-between-using-local-server-workspace
Like this, you can use Sublime Text for editing and have as much ST windows as you want. And you can do the check-in of files using the Team Explorer. This is how I work. One Visual Studio with one or more Sublime Text windows. Very light-weight, efficient and productive.

Reusing Visual Studio Debugging Visualizers

I am developing a Visual Studio Add-in where one of the controls is a settings editor similar to the locals or watch window. Because strings are one of the data types being displayed/supported in this control, I would like to add a text visualizer similar to Visual Studio's baked in visualizers for debugging. I have provided a picture below to illustrate exactly what I'm referring to:
http://imgur.com/fgSFDqw
Am I on my own, or is there a way to reuse the existing Visual Studio debugging visualizers in my project?
thanks :)
These visualizers appear to be tightly coupled to Visual Studio and are not available via any command or interface. If anybody discovers otherwise, I'd love to know :)

Where is the run button in a default installation of Visual C++ 2010?

I have download Visual C++ 2010 and everything is fine but I have a small problem. It does not have the method start without debugging. Why? and how can i run project?
You are probably using the Express Edition of Visual C++ 2010. Some functions have been hidden by default in these editions. I believe the Microsoft's intention behind this is to not confuse novice users as much.
Either use the keyboard shortcut (Ctrl+F5) or switch Visual C++ 2010 Express into Expert Mode. The Expert Mode setting can be found in the menu "Tools" under "Settings":
Screenshot of the Expert Settings option in Visual Studio Express http://www.nuclex.org/images/stories/blog/gamedev/visualstudio/visual-studio-2010-expert-settings.png
Unless it's changed it should be to just press Ctrl-F5 to run it without the debugger.

Resources