Everything SharePoint and XAML

My continuous learning of SharePoint, XAML, Silverlight, Windows Phone 7, Windows 8, Office, VSTO, C#…

Archive for the ‘SPDev’ Category

Slide Deck from SharePoint Saturday Indianapolis 2010

Posted by Steve Pietrek on February 1, 2010

Thank you to everyone who attended my “Silverlight 3 in SharePoint 2007” presentation at SharePoint Saturday Indianapolis on 1/31/2010. The deck and source code are available. I received many great questions and I will be working on updating my deck to incorporate the answers.

Thinking about starting a series of blog posts on my Silverlight in SharePoint experiences. Heck, have 3 blog posts based on my experiences today only. Any interest?

Posted in Silverlight, SPConferences, SPDev, SPUserGroups | Comments Off on Slide Deck from SharePoint Saturday Indianapolis 2010

Unit Testing with SharePoint and ASP.NET – TypeMock Isolator

Posted by Steve Pietrek on May 19, 2009

Unit Testing ASP.NET? ASP.NET unit testing has never been this easy.

Typemock is launching a new product for ASP.NET developers – the ASP.NET Bundle – and for the launch will be giving out FREE licenses to bloggers and their readers.

The ASP.NET Bundle is the ultimate ASP.NET unit testing solution, and offers both Typemock Isolator, a unit test tool and Ivonna, the Isolator add-on for ASP.NET unit testing, for a bargain price.

Typemock Isolator is a leading .NET unit testing tool (C# and VB.NET) for many ‘hard to test’ technologies such as SharePointASP.NETMVCWCF, WPF, Silverlight and more. Note that for unit testing Silverlight there is an open source Isolator add-on called SilverUnit.

The first 60 bloggers who will blog this text in their blog and tell us about it, will get a Free Isolator ASP.NET Bundle license (Typemock Isolator + Ivonna). If you post this in an ASP.NET dedicated blog, you’ll get a license automatically (even if more than 60 submit) during the first week of this announcement.

Also 8 bloggers will get an additional 2 licenses (each) to give away to their readers / friends.

Go ahead, click the following link for more information on how to get your free license.

Posted in SPDev, SPTools | Comments Off on Unit Testing with SharePoint and ASP.NET – TypeMock Isolator

SharePoint Saturday Atlanta Presentation

Posted by Steve Pietrek on April 20, 2009

Last weekend I presented at SharePoint Saturday in Atlanta. My talk was building custom timer jobs. Good turnout and questions. Thank you if you attended. I plan on writing more on the event in a separate post but I promised I would upload my deck. The link is below.

Custom Timer Job Presentation Link

Update 1: I am still in the process of uploading the code. I will update this post when that is complete.

Posted in SPConferences, SPDev, SPUserGroups | Comments Off on SharePoint Saturday Atlanta Presentation

SharePoint Object Dispose Guidance

Posted by Steve Pietrek on February 2, 2009

Last week, the Microsoft SharePoint team released SPDisposeCheck. SPDisposeCheck is a tool which will check your code and alert you when SharePoint objects are not being disposed of properly. Keith Dahlby has a good post where he warns people that SPDisposeCheck is not 100% perfect and should not be the end all. After the SPDisposeCheck tool was released to the public last week, I ran it against my source code for a decent size project I finished up with a few weeks ago. Fortunately, there were no issues reported. I am not posting to gloat; rather list things I did and resources I used to improve my code to avoid leaks.

Read the rest of this entry »

Posted in SPDev | Comments Off on SharePoint Object Dispose Guidance

jQuery 1.3 Released

Posted by Steve Pietrek on January 14, 2009

jQuery 1.3 was released today. Link

Posted in SPDev | Comments Off on jQuery 1.3 Released

Error Referencing SlideLibrary.asmx

Posted by Steve Pietrek on January 14, 2009

I am putting together a quick prototype where I want to have slide library integration in PowerPoint. I understand there is already PowerPoint integration in PowerPoint 2007 for slide libraries; however, it requires a higher version of PowerPoint (Enterprise and Ultimate) and the OOTB functionality does not meet my needs. Doing research yesterday, there is little information on the slide library web service (/_vti_bin/SlideLibrary.asmx). This link contains some good information on how the PowerPoint team is accessing SharePoint using the slide library web service (see image below). I have worked with a few of the SharePoint web services but never the Slide Library one. I did run into one issue when adding the reference which I wanted to document in this post.

Read the rest of this entry »

Posted in SPDev, SPErrors | Comments Off on Error Referencing SlideLibrary.asmx

Three SharePoint Controls: InputFormTextBox, PeoplePicker, DateTimeControl

Posted by Steve Pietrek on January 9, 2009

The Microsoft.SharePoint.WebControls namespace provide many controls which you can use in web parts or layout pages within SharePoint. Three controls I used recently on a project include:

Read the rest of this entry »

Posted in SPDev | 1 Comment »

Guidance for developing custom solutions with SharePoint 2007

Posted by Steve Pietrek on May 19, 2008

Glenn Block of Microsoft has requested your thoughts on developing with SharePoint. You can find the survey here and more information on Glenn’s blog here. Please note most of the survey is stacked ranking – confused me at the beginning.

Posted in SPDev | Comments Off on Guidance for developing custom solutions with SharePoint 2007

Better Alternative: Debugging Assemblies Located in the GAC

Posted by Steve Pietrek on February 28, 2008

I wrote a post listing steps for debugging assemblies located in the GAC. Today I ran into an issue, when I ran Start-Run-%SYSTEMROOT%AssemblyGAC, where the folder which contains my DLL was not available. After digging around, it appears the assembly is in the GAC but isn’t in the GAC.

Anyway, I poked around Visual Studio and found an improved option.

1. Open Visual Studio
2. Open Tools-Options and navigate to the Debugging item
3. Uncheck the option “Enable Just My Code (Managed only)”
4. Select Debug-Attach to Process.
5. Select the correct w3wp process. To know the correct w3wp process, see this post.
6. Set breakpoints accordingly.

Update: Doug Ware has a similar post – “great minds think alike”. It contains a little more information and pictures. Worth checking out.

Posted in SPDev | Comments Off on Better Alternative: Debugging Assemblies Located in the GAC

Debugging Assemblies Located in the GAC

Posted by Steve Pietrek on January 2, 2008

Update: Please see this post for a better alternative.

I have been creating feature receivers which I installed to the GAC. Of course I ran into issues and needed to debug the code. Below are the steps I ran through to do so:

  1. Install the assembly to the GAC. There are a few ways of doing this. First, create a WSP file which installs the assembly to the GAC. Second, you can use gacutil.exe to install it.
  2. Select Start – Run and type in %SYSTEMROOT%\Assembly\GAC_MSIL
  3. Open the folder which contains the DLL.
  4. Open the folder with the version number and public key you are interested in.
  5. Open Visual Studio 2005 or Visual Studio 2008.
  6. In the Solution Explorer, right-click on the solution and select Properties.
  7. On the Build tab, set the Output Path to the folder which contains the DLL (the folder in step #4).
  8. Build the project. This will copy in the PDB file to the GAC folder.
  9. Select Debug-Attach to Process.
  10. Select the correct w3wp process. To know the correct w3wp process, see this post.
  11. Set breakpoints accordingly.
  12. Execute code by activating/deactivating the feature in browser.

Note: I need to do some more research on this but the breakpoints were not hit if I activated/deactivated the feature using STSADM. Breakpoints were only hit when I activated/deactivated the feature in the browser. Just something to be aware of.

Posted in SPDev | 3 Comments »

ONET.XML, Site Definitions, and alternate default.aspx

Posted by Steve Pietrek on October 10, 2007

Today I ran into a frustrating issue. I was creating some custom site definitions and when I attempted to provision a site, I would get the “404 Not Found” error. Instead of creating a default.aspx, I created several derivatives with different names (e.g. defaultxxxxx.aspx). The issue was in the ONET.XML file in the modules section, I referenced the correct URL but did not give it a name.

    <Module Name=”CustomSite01Url=”” Path=””>

      <File Url=”default01.aspxName=”default.aspxNavBarHome=”TrueType=”Ghostable“>

        <NavBarPage Name=”$Resources:core,nav_Home;ID=”1002Position=”Start” />

        <NavBarPage Name=”$Resources:core,nav_Home;ID=”0Position=”Start” />

      </File>

    </Module>

Posted in SPDev | 2 Comments »

Iterate through Items in a List

Posted by Steve Pietrek on September 21, 2007

As a way to learn the SharePoint Object Model, I decided to create an application which will display all items (e.g. Sites, Subsites, Content Types, Features, Fields, Lists, Users, etc.) for a top-level site. I know there are other ones out there (SharePoint Inspector, Feature Explorer, etc.) but they don’t have all the features I want (I have ideas!) and what fun is it using someone else’s when you can create your own.

Read the rest of this entry »

Posted in SPDev | Comments Off on Iterate through Items in a List

Site and File Naming – Invalid Characters

Posted by Steve Pietrek on September 11, 2007

I ran into this issue a few days ago. “Essential SharePoint 2007” had a note on the subject.

SharePoint sites cannot contain the following characters:

\ / : * ? ” < > | # { } % & <TAB>

Files uploaded to SharePoint cannot contain the following characters:

: # % & * : < > ? \ { | } ~

BTW, ESP2K7 is an excellent book. Little on development – higher level topics instead – recommended nonetheless.

Posted in SPDev | 1 Comment »

Edit in Microsoft Office SharePoint Designer Error

Posted by Steve Pietrek on August 24, 2007

Today I attempted to edit the default.master file found in the Master Page Gallery by selecting the “Edit in Microsoft Office SharePoint Designer” option. I received the following error:

“The document could not be opened for editing. A Windows Sharepoint Services compatible application could not be found to edit the document.”

It seemed I had a mismatch of Office 2003/Office 2007 applications installed. I checked the list of installed applications and didn’t find any specific to Office 2003. Anyway, to fix, install the following hotfix (will require a reboot).

http://support.microsoft.com/kb/938888

Posted in SPDev | 1 Comment »

Turn off SharePoint Custom Error Messages

Posted by Steve Pietrek on July 28, 2007

Below is a list of steps to turn off SharePoint custom error messages so you can see the “true” ASP.NET error message along with the callstack/stack trace. I would recommend only making the following changes in a development environment – not production.

  1. Navigate to the site directory.
  2. Backup web.config.
  3. Open web.config.
  4. Switch Custom Errors off. Search for “customErrors” and set the value to “Off” instead of “On”. You can also set the value to “RemoteOnly” to troubleshoot a production issue.
  5. Enable CallStack. Search for “CallStack” and set the value to “true” instead of “false”.
  6. Save web.config.

Posted in SPDev | 1 Comment »

Quick Access to STSADM Command

Posted by Steve Pietrek on June 8, 2007

  1. Type Windows Key + Break to bring up the System Properties dialog.
  2. Click the Advanced tab.
  3. Click the Environment Variables button.
  4. In System Variables, scroll down and highlight the Path Variable.
  5. Click the Edit button.
  6. In the Variable Value text box, go to the end of the entry and type in a semicolon.
  7. Type in the following: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin
  8. Click the OK button in the Edit System Variable dialog.
  9. Click the OK button in the Environment Variables dialog.
  10. Click the OK button in the System Properties dialog.
  11. Open a command prompt and type in stsadm to test your work.

Posted in SPDev | 2 Comments »

Missing Windows SharePoint Services Workflow Code Snippets

Posted by Steve Pietrek on June 7, 2007

Today, while messing around with a SharePoint Hello World Workflow project, I ran into an issue where the code snippets for feature.xml and workflow.xml files went missing in Visual Studio 2005. I found this link.

Steps to Fix:

  1. In Visual Studio 2005, on the Tools menu, click Code Snippets Manager.
  2. Change the language to XML.
  3. Add [System]:\Program Files\Microsoft Visual Studio 8\Xml\1033\Snippets\Windows SharePoint Services Workflow to your snippets.

Posted in SPDev | 1 Comment »