How to: Count the lines of code (project/solution)
If you ever wondered how many lines your code is, you can easily get such information (along with other -arguably more important- bits) by hitting the Calculate Code Metrics. Right click on the project, half way down the pop up window, you will notice the option “Calculate Code Metrics”. This should bring up the window [...]
Read MoreHow to: Create a SP2007 Site Collection Template in VS2008 in XML only
So, the other day, I got a curious request. I was to provide a new site collection template, a custom template, that would be using no code whatsoever. The client did not want to deploy custom code to their production server. I had never created a site collection template before. Let alone one that would [...]
Read MoreHow to: Debug SharePoint applications (attach to process).
First of all, you will need to turn off the custom errors. If you haven’t already done so, click here to find out how to turn off SharePoint Custom Errors After you’ve done that, you will be able to get more information about your application errors straight from the error page that will be served [...]
Read MoreHow to: Troubleshoot “Web Application not found” errors in SharePoint 2010 development
When developing against SharePoint 2010, you might come across the following error: “The web application at [URL] could not be found. Verify that you have typed the url correctly. If the url should be serving existing content, the system administrator may need to add a new request url mapping to the intended application.” What this [...]
Read MoreHow to: Programmatically create a new Site Column in SharePoint 2010
As we’ve seen before, site columns can be created in a variety of ways, through the web interface, the SPD10 and the VS2010. We will now take a look at how to create a site column programmatically. That is, through the Visual Studio 2010. The main difference between creating a site column through the SPD10 [...]
Read MoreWhat is: Site columns, content types and lists
SharePoint 2010, just like its predecessor, supports the fundamental elements that made SharePoint 2007 such an important platform. Content types, site columns and lists. In the sense of SharePoint, everything is a list. A site column is a definition of a reusable -within the specified web site that they’ve been defined in- column. That means [...]
Read MoreHow to: Comment out Visual Studio code (keyboard shortcut)
Most starting developers always ask if there is a quicker method to commenting out a piece of code, than having to select the Comment Selection from the Edit menu. There is in fact a keyboard combination, even if it requires the sequential performance of two keyboard shortcuts. In order to comment out a selection, first [...]
Read MoreHow to: Undo “Exclude from Project” in Visual Studio
OK, so this is truly a silly post but I still remember how anxious I was the first time I mistakenly clicked on the “Exclude from Project” option in Visual Studio. What you need to remember is that “excluding” something from your project is not “deleting” it. It’s not even actually removing it from [...]
Read MoreHow to: Testing SharePoint installations and custom code
Testing the products of software development is, or should be, just as important as the development itself. Deploying a solution that does not work, or equally importantly, deploying a solution that worked in the development environment but for some reason, does not work in the production environment, is simply unacceptable. Visual Studio 2010 comes with [...]
Read MoreExplained: the Developer Dashboard
The developer dashboard is a new invaluable tool for the developer. It enables reading through the calls made at any time, so that the developer will know whether it is his/her own code slowing down the system or SharePoint itself. Items displayed in the developer dashboard include web part events, Windows Communication Foundation (WCF) calls, [...]
Read More