Wednesday, March 30, 2016

Web Services cannot find dll's in nested bin folders

When you create a new project and use a Class Library project type, the default configuration is to put the dll's in a folder named bin/release or bin/debug depending on your current build.  Then if you add a web service (either asmx or wcf), the web service will not be able to find the dll's because they are nested.  You must change the Project Properties, Compile tab, Build Output Path to just "/bin".

If you fail to do this, when you right click on the web service, and click View in Browser, you will get a parser error saying:  Could not create type.

This is a rare problem, because most of the time, you are creating a web project type that makes this configuration for you.

Friday, March 25, 2016

Visual Studio Solution Explorer Collapse All

When dealing with complex visual studio solutions with many projects, the solution explorer can become a mess of opened folders and files.  Solution Explorer remembers which folders you have opened, so if you're like me, you never go back and close the folders once you're done.  You just want to collapse the entire tree structure occasionally.  By default, you can collapse the current node of a tree by pressing the - sign on the number keypad.  But this only collapses the current node, and does not recursively close every sub folder.

This command does exist in Visual Studio, but it is not in the menu at least in the 2015 version that I have.  To use it, you have to assign a keyboard shortcut to it by going to the Tools menu and selecting Options, and then Keyboard like so:


Here I've set up a shortcut, so if I hold down CTRL while pressing CO, it will recursively collapse the current node in Solution Explorer.

UPDATE:  Don't use CTRL C as a starting sequence for your chord.  This will mess up the old standard CTRL C for Copy.  I ended up using CTRL O.