Windows SharePoint Services Products and Technologies blog by Harish Mathanan

Tuesday, September 29, 2009

Moving Blog

Apologies for the lack of postings, will be moving to a new blog platform. Link will be posted up soon. Thank you.

Tuesday, August 18, 2009

Trying to use an SPWeb object that has been closed or disposed and is no longer valid

Ran into this age long SharePoint error yesterday attempting to dispose my SPWeb object. It was totally my mistake, as my code was such:

SPWeb web = SPContext.Current.Web;

web.Dispose();

I had to re-educate myself on disposing of Windows SharePoint Services objects here. Happy learning to all :)

Multiline Textbox

Ever needed a multiline textbox for a web control and such? I had to do some poking around to find the property. Anyhow, I’ve pasted the snippet below, hopefully it’ll save you some time.

Textbox txt = new Textbox();

txt.TextMode = TextBoxMode.Multiline;

Friday, August 7, 2009

Almost got caught out by SP2

I decided to make life easy for myself and streamlined my SharePoint install with SP2 and other updates. A process that is easily achieved, later I created a SharePoint environment using the streamlined install. Also easily achieved, but this is where I should have remembered about the bug in where SP resets the SharePoint  to a trial version. Very annoyed with myself for forgetting this.

Just today I as I was poking around in Central Administration, I discovered this under Application –> Check Services Enabled in this Farm:

caughtOut

Thankfully, I had the product license key nearby. To rectify:

1) Central Administration –> Operations –>  Convert License Type

2) Enter in the product key and click OK

caughtOut2

3) All complete

caughtOut3

Not going to get caught out again, that’s for sure :)

Thursday, August 6, 2009

VSeWSS 1.3 CTP Error: the response message does not match the content type of the binding

I got this error the other day trying to deploy a simple Silverlight 3 web part. The whole project builds perfectly well. It just can’t deploy, and every time I try,  this is what would happen:

Error    1    The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>IIS 7.0 Detailed Error - 500.0 - Internal Server Error</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;background:#CBE1EF;}
code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;}
.config_source code{font-size:.8em;color:#000000;}
pre{margin:0;font-size:1.4em;word-wrap:break-word;}
ul,ol{margin:10px 0 10px 40px;}
ul.first,ol.first{margin-top:5px;}
fieldset{padding:0 15px 10px 15px;}
.summary-container fieldset{padding-bottom:5px;margin-top:4px;}
legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;}
legend{color:#333333;padding:4px 15px 4px 10px;margin:4px 0 8px -12px;_margin-top:0px;
border-top:1px solid #EDEDED;border-left:1px solid #EDEDED;border-right:1px solid #969696;
border-bottom:1px solid #969696;background:#E7ECF0;font-weight:bold;f'.        0    0

After poking around the internet I found the solution to my problem on the MSDN forum. I had to enable WCF Activation. To do this:

  1. Open up Server Manager
  2. Select Features, then Add Features
  3. Expand the .NET Framework 3.0 Features
  4. Expand WCF Activation
  5. Tick and select HTTP Activation. This will automatically select WCF activation for you.
  6. Click Next to Add the feature, that’s it.

Hope this saves you time & hassles looking around.

 
Copyright Harish Mathanan 2008