Monday 25 March 2013

SharePoint 2013 - Fix for Exception - Microsoft.SharePoint.SPException: Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))

I received the following exception when creating new custom field types in SharePoint 2013. I couldn't even open the List Settings page (via the Web UI, SharePoint Designer or SharePoint Manager).

To resolve, you simply have to rename any potentially problematic custom field types e.g. rename fldtypes_MyCustomField.xml to zzfldtypes_MyCustomField.xml". You can find your field types located in %Program Files%Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\XML. Restart IIS after each rename.

This will get you back up and running - and you will now know what custom SharePoint field type is causing the issue.

Full Exception Details as below:

Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.SharePoint.SPException: Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION)) ---> System.Runtime.InteropServices.COMException: Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))   
at Microsoft.SharePoint.Library.SPRequestInternalClass.GetFieldTypeInfo(String bstrUrl, Boolean bInternal, Object& pvarTypeNames, Object& pvarTypeDisplayNames, Object& pvarTypeShortDescriptions, Object& pvarBaseRenderingTypeNames, Object& pvarFieldTypeClasses, Object& pvarFieldEditorUserControls, Object& pvarPropertySchema, Object& pvarTypeInfoFlags)   
at Microsoft.SharePoint.Library.SPRequest.GetFieldTypeInfo(String bstrUrl, Boolean bInternal, Object& pvarTypeNames, Object& pvarTypeDisplayNames, Object& pvarTypeShortDescriptions, Object& pvarBaseRenderingTypeNames, Object& pvarFieldTypeClasses, Object& pvarFieldEditorUserControls, Object& pvarPropertySchema, Object& pvarTypeInfoFlags) -
-- End of inner exception stack trace ---   
at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)   
at Microsoft.SharePoint.Library.SPRequest.GetFieldTypeInfo(String bstrUrl, Boolean bInternal, Object& pvarTypeNames, Object& pvarTypeDisplayNames, Object& pvarTypeShortDescriptions, Object& pvarBaseRenderingTypeNames, Object& pvarFieldTypeClasses, Object& pvarFieldEditorUserControls, Object& pvarPropertySchema, Object& pvarTypeInfoFlags)   
at Microsoft.SharePoint.SPFieldTypeDefinitionCollection..ctor(SPWeb web, Boolean internalCall)   
at Microsoft.SharePoint.SPField.GetFieldTypeDefinitionForType(SPFieldCollection fields, String strType)   
at Microsoft.SharePoint.SPField.get_FieldTypeDefinition()   
at Microsoft.SharePoint.SPField.get_TypeDisplayName()   
at ASP._layouts_15_listedit_aspx.__Render__control13(HtmlTextWriter __w, Control parameterContainer)   
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)   
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)   
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)   
at Microsoft.SharePoint.WebControls.AjaxDelta.RenderChildren(HtmlTextWriter output)   
at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer)   
at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)   
at Microsoft.SharePoint.WebControls.AjaxDelta.Render(HtmlTextWriter writer)   
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)   
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)   
at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)   
at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)   
at Microsoft.SharePoint.WebControls.SharePointForm.Render(HtmlTextWriter output)   
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)   
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)   
at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)   
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)   
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)   
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)   
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)   
at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.RenderChildren(HtmlTextWriter writer)   
at System.Web.UI.Page.Render(HtmlTextWriter writer)   
at Microsoft.SharePoint.WebControls.DeltaPage.RenderToBase(HtmlTextWriter writer)   
at Microsoft.SharePoint.WebControls.DeltaPage.Render(HtmlTextWriter writer)   
at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.Render(HtmlTextWriter writer)   
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)   
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)   
at System.Web.UI.Page.HandleError(Exception e)   
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)   
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)   
at System.Web.UI.Page.ProcessRequest()   
at System.Web.UI.Page.ProcessRequest(HttpContext context)   
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()   
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

DDK

Saturday 23 March 2013

Microsoft Licensing - Can I Purchase Microsoft Software from overseas and use it here in Australia?

With the Federal Government inquiry into the inflated prices of software in Australia, it has become quite clear (officially) that there is a price differential between Australia and most of the world (especially the US). When the CEOs (such as Pip Marlow from Microsoft) were asked why the prices are different, it basically comes down to the fact "because we can". When I did commerce at UNSW, this was known in palatable terms as "extracting the consumer surplus through price discrimination".

The enormity of the price difference became clear when we decided to purchase Microsoft Visual Studio 2012 with MSDN here in Oz.

As per http://msdn.microsoft.com/en-au/subscriptions/buy.aspx

Australia - $21,202 (AUD)
USA - $13,299 (USD)



It has been suggested by some (including Choice Magazine no less) that it would be much cheaper to send someone over to the USA in luxury, purchase it and then bring it back home (if that were neccessary).

However, this would then not be in compliance with the licensing agreement as outlined at http://www.microsoft.com/licensing/licensing-options/open-regional.aspx. The line that specifically prohibits you purchasing from another region (such as the USA) is "Customers and resellers must place agreements and orders with partners within the same defined region."
 
So if you even attempt to purchase from a buyer outside your region and ship it back in, you would be outside the terms of the agreement and have unlicensed and illegal software. This got me thinking laterally within the bounds of our licensing region. Looking at other options within the APAC (Asia Pacific) region, the prices are as follows:
Country of Purchase Amount (Local Currency) Amount in AUD
Korea ₩15,730,600.00 $13,461.00
Brunei
$17,814.00
$13,653.00
Singapore $17,814.00 $13,653.00
Malaysia RM46,081.00 $14,196.00
Thailand ฿451,605.00 $14,763.00
Phillipines Php643,970.00 $15,113.00
New Zealand $26,369.00 $21,040.00
New Caledonia $13,299.00 $12,754.00
Australia
$21,202.00
$21,202.00
Indonesia
$15,294.00
NA - Rupiah Not Provided
Vietnam $15,294.00 NA - VND not provided

So you can save $7,741 by purchasing the same product from New Caledonia as opposed to Australia.

Looking into the License terms and conditions for MSDN with Visual Studio Ultimate specifically, there is a list of "General Terms and Conditions" that can be found here:
http://www.microsoftvolumelicensing.com/ProductPage.aspx?pid=422. More specific product use rights can be found here: http://www.microsoftvolumelicensing.com/userights/Downloader.aspx?DocumentId=6131

Conclusion:
1) There is nothing specifically in the January 2013 Microsoft Product Usage Rights document about purchasing a product from another country (inside or outside your licensing region) and using it elsewhere.
2) There is only a subtle hint on the "Microsoft Open Programs Affiliate Participation Policy" page that you shouldn't be contacting partners outside the APAC licensing region (say an Australian going to the US) to purchase your software.

To be completely in the clear, you can purchase from somewhere like New Caledonia (or Korea) and save yourself in excess of $8K. This is provided it's OK that:
1) You have someone at the other end who can receive your invoice for you (or you will fly/kayak/swim over there to receive it) - or you don't care about the invoice at all.
2) You don't need the DVDs.

For $8K, many would consider these to be small sacrifices indeed!

[Update 18/07/2013] - I've had a few emails about this post. We ended up purchasing the AU licenses as it was seen as too much of a risk on a large purchase to have a potentially unsupported product. Microsoft also called us up to confirm we were who we said we were - so if you desperately want to save money and still have a legitimate MSDN license, I recommend you set up both postal and phone redirection!

DDK