问题
I used to be able to build and run my console applications by hitting Ctrl + F5 in visual studio. This no longer works. I looked everywhere. Does anyone know how to re-enable this command?
回答1:
Might be a ridiculous suggestion but does your keyboard have some kind of "F Lock" key? Happened to me after I got a new keyboard and accidentally hit it. Didn't even know it was there :)
回答2:
Before you trash all your settings, consider just resetting the Keyboard preferences:
In Tools / Options / Environment / Keyboard there's a drop-down for your Keyboard scheme and next to it a Reset button. Make sure the mapping scheme is set to whatever you want then hit the Reset button.
回答3:
I have had a similar problem where some of my shortcuts (such as the Alt+Shift+F10 intellisense shortcut) stopped working...
I fixed it by going to Tools -> Import and Export Settings -> Reset all settings.
I was able to reimport my saved settings after I had reset them also but only with out the broken short cuts!
Hope this helps!
回答4:
I had a similar question, and reading this thread led me to an answer which is similar to the f-Lock key answer. I'm using a new laptop, and re-introducing myself to programming. When the book said press Ctrl-F5 I did so and the only thing that happened was that my monitor got slightly dimmer, though it returned to normal brightness as soon as I clicked on a few other things. What I noticed after reading this thread is that this new-fangled keyboard has a blue Fn key, and all the function key names are printed in blue. In other words, to get the function key functionality you have to be holding down the blue Fn key when you tap the actual function key. So F5 becomes Fn-F5 and Ctrl-F5 becomes Ctrl-Fn-F5. This is on a Dell Inspiron 1564. This is not quite as egregious as a F-Lock key, so I hope I'll get used to it soon.
回答5:
I fixed this by pressing Fn + F5, this is right next to the Windows Button.
回答6:
One day it happened to me when I made some changes to the project and solution files in my ASP .NET project. When I opened it in Visual Studio, it allowed me to rebuild but not to run nor debug (the menu option didn't appear and the Ctrl + F5 didn't work).
What I did to make it work again was right-click over the solution, into the Visual Studio "Solution Explorer" tree tab in the right, where all the files of your project appear, and select properties.
Then, select there a project, and put it as start project.
Perhaps this is your problem here. If not, I hope it can help someone in the future.
回答7:
Chances are you changed your default settings. Go to Tools->Import and Export Settings... Select 'Reset all', Click 'Next' and choose the 'Visual C# Development Settings' option.
回答8:
It happend to me something similar, but only with one project, and the others running right with CTRL + F5, so i will post here my problem and solution because it could help people searching for the same problem, as i was :)
I was opening in Visual Studio 2012 a solution created with Visual Studio 2013, and it didn't run with CTRL + F5. I open the solution file with notepad, and i change the following section:
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
with this other:
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_x86|Any CPU = Debug_x86|Any CPU
Debug_x86|x86 = Debug_x86|x86
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
PruebaRelease|Any CPU = PruebaRelease|Any CPU
PruebaRelease|x86 = PruebaRelease|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
That solves the problem for me.
回答9:
This keyboard shortcut is set by default in os x, you need to disable it to use ctrl+F5. Have a look at http://www.daniellewis.me.uk/2015/07/01/ctrl-f5-not-working-in-a-windows-vm-running-on-parallels/ to fix. I can run without debugging now in my VM.
回答10:
I had a similar problem with Alt+F7 (Find Usages in Resharper). Turns out the GeForce Experience was taking the shortcut for it's Sharing functionality. Uninstalled GE and all is good.
来源:https://stackoverflow.com/questions/913054/visual-studio-commands-dont-work-ctrl-f5-doesnt-run-my-application