WCF WebHttp Services in .NET 4 Part of the official .Net 4.0 framework release. WCF WebHttp Services is the flavor of WCF that is most appropriate for developers who need complete control over the URI, format, and protocol when building non-SOAP HTTP services— services that may or may not subscribe to RESTful architectural constraints. Documentation [...]
Archive for the ‘.net’ Category
What is the current state of REST frameworks in .Net 4.0
Posted in .net, frameworks, rest, tagged .net, frameworks, wcf on July 22, 2011 | Leave a Comment »
How to add custom validators to the SharePoint ListFieldIterator
Posted in .net, sharepoint, tagged BaseValidator, sharepoint ListFieldIterator on April 28, 2010 | 3 Comments »
Requirements Today I had the requirement to add custom validation logic to a SharePoint edit form. The edit form is being displayed using a ListFieldIterator. The requirement was to make sure the Date field could not be set to a date in the past. The solution (Other solutions are available and are most probably better!) [...]
How do you update the ‘Author’ or ‘Created by’ and ‘Editor’ or ‘Modified By / Last Modified’ fields of a list item (SPListItem)
Posted in .net, sharepoint, tagged sharepoint, SPListItem, SPListItem.UpdateOverwriteVersion() on April 21, 2010 | 3 Comments »
Sometimes it’s useful to overwrite the created by and last modified by fields and get rid of that pesky ‘System Account’ ! Created By The internal field name for the person who created a list item is ‘Author’ use SPBuiltInFieldId.Author to access this field. The display name for this field is ‘Created By’ it can [...]
Cannot change the lookup list of the lookup field.
Posted in .net, sharepoint, tagged sharepoint, SPFieldLookup on February 8, 2010 | 5 Comments »
Ever get this error message SPException “Cannot change the lookup list of the lookup field.” Once a lookup field (SPFieldLookup) has had it’s LookupList and LookupWebId set you can’t change them. There is a good reason for this if your lookup field is used in multiple lists or already has data entered, you would effectively [...]
Programmatically determine is a feature is activated or even installed
Posted in .net, sharepoint, tagged sharepoint, SPFeature, SPFeatureCollection, SPFeatureDefinition on December 17, 2009 | Leave a Comment »
Okay so ever needed to see if a particular web or site feature is activated? Well if it’s activated it will be in the SPWeb.Features SPFeatureCollection or SPSite.Features. If it’s not activated it won’t be. Simple. To check if a feature is installed examine the feature definitions collection on the SPFarm object, below are a [...]
Lookup the Netbios name of a domain using directory services
Posted in .net, tagged .net, ActiveDirectory, DirectoryServices, Domain on December 14, 2009 | 1 Comment »
Okay so its pretty easy to get the fully qualified domain name (FQDN). But what happens if you want to get the old-skool netbios name. The quickest way is to use System.Environment: This gets the network domain name associated with the current user. So not much good if your code is running as a service [...]
My SVN Global Ignore Pattern for C# and Resharper
Posted in .net, development, tagged .net, devenvironment, svn, tortoisesvn on November 11, 2009 | Leave a Comment »
XslCompiledTransform !♥ the UTF-8 BOM : System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
Posted in .net, tagged xslt on September 9, 2009 | Leave a Comment »
Recently I came across a rather annoying issue with the XslCompiledTransform class. Namely it really doesn’t like having a BOM (byte order mark) shoved down it’s load method. I got a the follow error message and stack trace Viewing the input data to the XslCompiledTransform in debug mode showed a perfectly valid and lovely XSLT [...]
Performance profiling SharePoint sites using Redgate ANTS Profiler
Posted in .net, performance, sharepoint, tagged performance, sharepoint on August 28, 2009 | Leave a Comment »
I used the 5.0 evaluation copy of RedGate ANTS profiler tool on a standard Windows Sever 2003 R2 / SharePoint 2007 virtual machine. To get profiling working with my SharePoint code base I made the following adjustments: Allow site collection administrator to “Act as part of the operating system” and “Impersonate a client after authentication” [...]