How do i stop visual studio 2017 from building on save - c#

I am unsure what has happened, but i restarted my VS2017 Enterprise and it has been building the entire solution each time i save. I have tried going into Tools > Options but i cannot figure out where the option to disable this is. I also have ReSharper installed. Not sure if that is the issue.

I think you have Continuous Testing enabled via ReSharper. In particular, it is configured to On 'Save' Build and...
To disable it, go to the menu option ReSharper->Unit Tests->Continuous Testing
And then select the option you desire from the Mode drop down on the popup window toolbar

Related

Visual Studio loses ability to attach to Unity, why?

I'm using Visual Studio with Unity. In general in VS I can simply click "Attach to Unity" and it will build the solution and indeed attach to Unity.
Sometimes, however, a project loses the "ability" to do so, what means that suddenly clicking the button will only build the solution and not attach to Unity.
I really would like to know what's happening there as I'm not aware of doing anything that could result in such a behaviour.
There are some parameters that might have an effect:
it happens only for some Unity projects: a project is either "infected" or it happens never (on my watch)
if it starts happening it will always happen until I reboot the PC (closing VS and Unity is not enough)
For me (Unity 2020.x and VS19) this happens quite often.
Simply close VS and in Unity > Edit > Preferences > External Tools
Click on "Regenerate project files" (you don't need to check anything else, just click the button)
Start VS again, and it should work as normal.
For me "Attach to Unity" disappeared from the toolbar.
But I still have a button in Debug -> Attach Unity Debugger
Hope it will help someone.
Visual Studio Community 2019 16.7
Unity 2020.1.2f1
To prevent this from happening:
When there are compiling errors in your code, don't double click on Unity Debug Log line, which opens VS at the line that threw the error, but it messes with the project files.
Regenerating the project files under Unity > Preferences > External Tools > Regenerate Project Files. Also make sure that Visual Studio is set under external tools, as well as all the Unity dependencies are correctly installed via the Visual Studio installer.
Visual Studio will prompt you to reload the project, optionally rebuild your entire solution in VS and restart both Unity and VS.
Delete all visual studio related files from the project folder. sln, csproj, vs (hidden) folder.. Reopen project with unity hub, edit one of script and all files will be generated and you will see Attach to Unity button again.
This is a quite common issue when using Unity. Me and my colleges have experienced this a couple of times each month. It usually automatically "repairs itself" after restarting VS/Unity or in worst case rebooting the computer.
Now, I've got this problem again with latest VS2019. I've tried:
Generate a new clean project
Rebooting
Regenerated all visual studio files
Reinstall VS 2019 (clean)
Reinstall Unity (It is clean - I'm only using one! editor version)
All the above suggestions
Are there any network-related issue to this or how does the attach to Unity works ? Can I check some log-files related to this?
Last time this happened to me, I needed to reinstall Windows. I might be in that situation again.
I had a similar issue, underneath the file tabs does it say miscellaneous files? To fix it I right clicked the Assembly C-Sharp in the solution explorer and rebuilt the project as shown in the picture.
Normally just restarting visual studio is sufficient, this issue was addressed and fixed by MS in VS around early december. Previously it happened each time you made a new script file.
Make sure you have installed the latest visual studio patch, as well as the "visual studio tools for unity"
I had this issue once, what fixed it for me was reconnecting Visual Studio to Unity Edit > Preferences > External Tools > External Script Editor
Also check the correct version of Visual Studio is listed there.
For Unity 2020.1.1 and above
in VisualStudio19:
go to "Build" -> "Rebuild Solution"
Unity > Edit > Preferences > External Tools > Editor Attaching
In my case (Unity 2020.2, VS Code 1.53.2) Attaching Debug option is missing on Unity.
After restarting my macbook,
Open VS Code
Open Unity
In VSCode-> Run -> Start Debugging
Unity show up to me alert just like below.
I choose Enable debugging for all projects option.
I hope, It will help someone.

Stopping Continues Testing recompilation stealing cursor in Visual Studios 2017 and Resharper

I have just started out on my journey to learn TDD with C# and to help me I have started using Reshaper 2017.1.3 Continues Testing tool to re-run all my tests that are affected by my modifications upon saving. I was hoping this would be a seamless experience with no interruptions to development but every time the projects need to be recompiled the cursor is stolen from the editor and placed inside the Output Pane which leads to a halt in development.
Is there any way to stop this behaviour without having to sacrifice the convince of the Continues Testing tool?
This might be Visual Studio behaviour - try unchecking the "Show output window when build starts" option in Tools → Options → Projects and Solutions → General.
If this doesn't help, please report an issue: youtrack.jetbrains.com
In my case I wanted to keep the focus in the editor after running my program and this solution is still available in 2021 for Visual Studio 2019.
Here is a screenshot for Visual Studio in French:

Visual Studio 2015 not working after first successful debug

I have updated Visual Studio 2015 to the first update. Since then I cannot debug my code twice in a row. It goes like this:
I start VS and try to debug. So far OK
Change code, build and debug.
Try to reach a web but it never loads.
If I close the VS and load the solution again it works or If I do not change code in step 2.
Other thing I noticed is the IIS Express Worker process is consuming most of CPU time.
And apparently the symbols are not loaded (I do not see the messages of DLL loading in the status bar).
This is making my development process very slow and tedious.
The solution is a MVC project under 4.6.1 framework.
Any ideas? Thank you very much!!
You should boot Visual Studio into Safe Mode. To enter safe mode do the following:
Open Command Prompt, as Administrator.
Enter: cd C:\Program Files (x86)\Microsoft Visual Studio 14.0
Enter devenv.exe /safemode
If Visual Studio does load and debug, then more than likely an extension or an update is the culprit. This will allow you to also see which updates may have occurred. The other potential issue would be if your Internet Information System had an issue.
Otherwise if your Internet Information System is stuck 'on'.
CTRL + ALT + DELETE
Go to processes, end W3P process.
Try to launch and debug inside Visual Studio.
Otherwise, simply try restarting your computer. We would need more information, as this can occur for an assortment of reasons.
#Julen - I have the same issue as you and I have found a work-around.
Add the "Terminate all" button to your toolbar and use it instead of just stopping the debugging. This command kills the IIS Express process.
See how to add it here:
Automatically Kill IIS Express Process After Debugging (VS Express 2013 Web)
If your IIS doesn't shut down after stopping the debugger, you could do one of the tricks written in this blog post - but the opposite way because the article focuses on keeping the debugger on.
Here is the proposed solution 2 - to check "Enable Edit and Continue":
Similar to VS 2013, if you disable Edit and Continue IIS Express will continue to run when you stop your debug sessions.
Open the menu item Tools/Options, look for the Debugging/General option. Scroll down and uncheck “Enable Edit and Continue”
It might be hanging when trying to load external symbols. I had a problem with that before.
To test this theory:
Open the Tools menu.
Click 'Options'.
Find and expand 'Debugging' on the left.
In the 'Symbol file (.pdb) locations' list, uncheck everything.
Click OK and see if the problem reappears.

Visual Studio 2013 start profiling greyed out

I used to work with the built in profiler of Visual Studio once in a while and found it a very useful tool.
Now, I can't do this, because the menu items "Start profiling" and "Start profiling paused" under Analyze->Profiler are greyed out.
It's a Windows Form Solution.
Any idea what might be causing this?
Microsoft Visual Studio Premium 2013 /
Version 12.0.31101.00 Update 4 /
Microsoft .NET Framework
Version 4.5.51650
Open performance explorer window (analyze -> windows -> performance explorer) and see if you have selected any target.
If not add your windows forms project as target (right click on "Targets" and follow menus) than you should be able to start profiling.
EDIT: Be sure to include your start up project as one of the Targets. You can right click this target and uncheck "collect samples" if you don't want sample data from this project.
It worked for me choosing
Debug->Start Diagnostic Tools without debugging(Alt+F2)
menu option. This will bring the Performance Wizard and from there you can continue doing what you want.

How to disable script debugging in Visual Studio 2010 when running Asp.Net website project?

I'm creating a website in Visual Studio 2010. I would like to use Visual Studio for C# debugging, without using it as JavaScript debugger. Is there a way to disable script debugging for Asp.Net website projects? I run my projects by hitting F5 in my Visual Studio.
(I've noticed that when I attach the debugger manually, I can specify the type of stuff I would like to debug.)
Note: I would like to debug JavaScript, but not with Visual Studio 2010. The Developer Toolbar will suffice.
See this article on Connect, and the other article it links to.
To summarise, it's a workaround. Apparently VS can't attach the debugger to both Silverlight and script so if you turn on Silverlight debugging, it has to disable script debugging! To access these settings, go to Start Options which is within the web site Property Pages.
Just go to Debug->Options & Settings and select Just-In-Time and Uncheck Script from Types of Code to enable debugging.
This will disable script debugging.
I had same problem on VS2015. There you can choose on which browser you run/debug project. I think older VS opens default browser, so you should change that.
Anyway, I set project to open in chrome and then I manually opened IE and copy-paste the URL from chrome. VS doesn't debug javascript in that case.
On website project left click on project in solution explorer and go to the project properties->go to the Web tab->scroll to the bottom of this tab and on Debuggers area select ASP.NET and Silverlight checkbox. It will disable script debugging.
If u r using IE 8.0 then go to tools-Internet options-advance tab- and uncheck Disable script debugging. Its works fine here.

Categories