Tag Archive: Visual Studio


How to check if nuget package files failed to be added to your checkin (Visual Studio 2013)

package_management

TFS Hates Nuget

In Source Control Explorer, go to the packages folder, right-click and Compare server to local to see all the package files that didn’t get checked in.  Ctrl-Click all the files it found locally but not on server and right-click Add, then check in again.

How to get rid of double-quote typing issue in Visual Studio

After installing a recent version of Visual Studio, pressing the shift-quote doesn’t type a double quote until you hit it a second time, at which point two double quotes are typed.  Here’s how to be able to type a single double-quote like a normal person with each key press.

How to fix: In Visual Studio, go to TOOLS –> Options –> Environment –> International Settings, change the Language to “Same as Microsoft Windows”.  Hit ok and restart Visual Studio.

Make sure your Windows settings are set correctly: Control Panel –> Region and Language –> Keyboards and Languages –> Change Keyboards…   Set Default Input Language to “English (United States) – US” (Not “English (United States) – United States-International”) .  Hit ok and restart Visual Studio.

Resharper 8 Cheatsheet

I’ve found this cheatsheet to be the best way to learn all the secret shortcuts in Resharper that really help to speed up development in Visual Studio and make life easier.  For months I had it pinned to my cube wall until I used them so much they’re muscle memory.

I’ve been using Resharper since way back and I also use their other dev products like IntelliJ so I use the Resharper 2.x/IntelliJ scheme:
http://www.jetbrains.com/resharper/docs/ReSharper80DefaultKeymap_IDEA_scheme.pdf

You can also use their Visual Studio style scheme:
http://www.jetbrains.com/resharper/docs/ReSharper80DefaultKeymap_VS_scheme.pdf

If you want to change your shortcut scheme (or you aren’t sure what it’s set to), in the Visual Studio top menu go to Resharper –> Options –> Keyboard & Menus, then select “Visual Studio” or “Resharper 2.x or IntelliJ IDEA” and Apply Scheme and Save.  Then hit a shortcut like Ctrl+Shift+N and a menu pops up saying there’s a conflict in shortcuts and asks which scheme do you want to use.  Select “Visual Studio” or “Resharper 2.x or IntelliJ IDEA” and check the Apply to All.  You can switch to the other schema at any time.

resharper_menu

As you know, Visual Studio’s “Clean Solution” doesn’t always delete everything from your bin and obj folders. Wouldn’t it be awesome if you had a bulletproof way of deleting all your bin and obj folders in your solution just by typing “DeleteBinObj” in your Package Manager Console? Now you can! Here’s how:

In your Visual Studio solution folder, create a file called “DeleteBinObj.ps1” that includes this code:

##########################################################
# PLEASE READ:
# 
# This script will be loaded by Visual Studio only when
# the solution is loaded therefore any changes you make 
# to it will not be effective until after you exit Visual 
# Studio and reload the solution.
##########################################################
function global:DeleteBinObj()
{
	Get-ChildItem .\ -include bin,obj -recu -Force | remove-item -force -recurse
}

In Visual Studio, go to your Solution Items folder (or create one) and Add Existing Item, pointing to the DeleteBinObj.ps1 file you just created.

Now close and reopen Visual Studio and load your solution.

In the Package Manager Console, enter the command

DeleteBinObj

If you refresh your projects, you’ll see that the bin folders are gone and the obj folders are gutted (sometimes a couple TemporaryGeneratedFiles linger in the obj directory).

Enjoy!

Run web apps in localhost without having to run Visual Studio in admin mode

If you want to run your apps in localhost through IIS Express without having to launch Visual Studio in admin mode every time, run this one-time command through an admin-elevated cmd (replacing your app name and port):

>netsh http add urlacl url=http://localhost.myapp.com:1337/ user=everyone

Now you can launch Visual Studio in normal mode and when you Ctrl-F5, you won’t get a “failed to register url” error.

© 2017 Robert Corvus