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.
Wednesday, March 30, 2016
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.
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.
Friday, February 26, 2016
WCF Timeouts
Timeouts can be configured on either the client side or the server side. They are set on the binding element in the web.config file. See here for the specific details.
Client side timeouts are pretty self explanatory. If you don't receive the response in the specified time period, the connection is closed and your code moves on. Server side timeouts work a bit differently than I expected. First of all, when you set a server side timeout, you are saying "After the connection is opened up, if I don't receive the full request in the specified amount of time, I'm going to time out." What it is not saying is "If I receive the request and it takes me longer than the specified time to process the request, I time out." You'll just keep churning away probably until your database connection times out. I believe client side timeouts are set to a minute by default, but can be lengthened.
Client side timeouts are pretty self explanatory. If you don't receive the response in the specified time period, the connection is closed and your code moves on. Server side timeouts work a bit differently than I expected. First of all, when you set a server side timeout, you are saying "After the connection is opened up, if I don't receive the full request in the specified amount of time, I'm going to time out." What it is not saying is "If I receive the request and it takes me longer than the specified time to process the request, I time out." You'll just keep churning away probably until your database connection times out. I believe client side timeouts are set to a minute by default, but can be lengthened.
Thursday, February 25, 2016
Monday, February 1, 2016
Favorite Visual Studio Options
I recently upgraded to Visual Studio 2015, and had to set it up to my liking. Since I only upgrade about every 2 years or so, I always forget where these settings are. So, today, I'm going to make a note of these settings:
Monday, December 14, 2015
The "12 Hive" location in SharePoint 2007
C:\ProgramFiles\Common Files\microsoft shared\Web Server Extensions\12
Thursday, November 5, 2015
Prevent "Click Jacking"
One way to prevent "Click Jacking" is to prevent other sites from displaying your site in a frame. To accomplish this, simply add this to your web.config:
<system.webServer>
...
<httpProtocol>
<customHeaders>
<add name="X-Frame-Options" value="DENY" />
</customHeaders>
</httpProtocol>
...
</system.webServer>
Subscribe to:
Comments (Atom)