WSS: Exceptions

 In this post I will add exceptions when I meet them.

HTTP 401.1 Unauthorized

Description of error:

Entering CentralAdmin did not cause unauthorized, but entering a site on my VPC gave 401.1 Unauthorized

Possible reason:

Windows update installed some updates.

Possible solution:

1) Disable loopback checking.

or

2) Remove following KB’s:

  • KB959426
  • KB960803
  • KB952004
  • KB963027
  • KB961373
  • KB956572

The only KB I could leave from the update bacth that day was:

  • KB923561

Do also turn off automatic update, so the updates will not be rolled on again.

InvalidCastException – ScriptingScriptResourceHandlerSection

Exception:

[InvalidCastException: Unable to cast object of type ‘System.Web.Configuration.ScriptingScriptResourceHandlerSection’ to type ‘System.Web.Configuration.ScriptingScriptResourceHandlerSection’.]
   System.Web.Configuration.ApplicationSettings.EnsureSectionLoaded() +70

Description of error:

Preconditions: The WSS server was initially installed with VS2005 with Ajax toolkit as an extra addon. This included the component:
System.Web.Extensions, Version=1.0.61025.0.

Later on the WSS server had installed VS2008 with Ajax toolkit included. This included the component:
System.Web.Extensions, Version=3.5.0.0.

The code tried to add a scripmanager:

ScriptManager sm = ScriptManager.GetCurrent(this.Page);
if (sm == null)
{
sm = new ScriptManager();
}
this.Controls.Add(sm); //Exception

The code had a reference to the version 3.5. In web.config all references were to the version 1.0.

Possible solution:

In web.config replace all references to System.Web.Extensions, Version=1.0.61025.0 with System.Web.Extensions, Version=3.5.0.0.

Tip: Changes to web.config should be done through a feature deployment.

Furthermore I got a hint about another fix, that allows Ajax 1.0 components to use .NET3.5:

<dependentAssembly>
  <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
  <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>

Thanks to Erik Norström for that one.

Links:

Failed to create feature receiver object – Value cannot be null

Test Case:

When activating a feature:

http://projectportal.mycom.xx/_layouts/ManageFeatures.aspx?Scope=Site

Exception:

Failed to create feature receiver object from assembly “Portal.Collaboration.GeneralWebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=de0229056b231893”, type “Portal.Collaboration.GeneralWebParts” for feature e1eb6c56-be55-411d-85d4-67e030d20d9e: System.ArgumentNullException: Value cannot be null.
Parameter name: type
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()   at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()
   at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce)
   at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, Boolean fForce)
   at Microsoft.SharePoint.SPFeatureCollection.AddInternal(Guid featureId, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly)
   at Microsoft.SharePoint.SPFeatureCollection.Add(Guid featureId)
   at Microsoft.SharePoint.WebControls.FeatureActivator.BtnActivateFeature_Click(Object objSender, EventArgs evtargs)
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Description of error:

ReceiverAssembly is OK, but ReceiverClass was not found.

Feature.xml:
<?xml version=”1.0″ encoding=”utf-8″?>
<Feature  Id=”e1eb6c56-be55-411d-85d4-67e030d20d9e”
          ReceiverAssembly=”Portal.Collaboration.GeneralWebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=de0229056b231893″
          ReceiverClass=”Portal.Collaboration.GeneralWebParts.GeneralWebParts”
          xmlns=”http://schemas.microsoft.com/sharepoint/”&gt;
</Feature>

Solution:

Correct the line

          ReceiverClass=”Portal.Collaboration.GeneralWebParts.GeneralWebParts”
to

          ReceiverClass=”Portal.Collaboration.GeneralWebParts”

InvalidOperationException – Extender controls

Exception:

[InvalidOperationException: Extender controls may not be registered before PreRender.]
   System.Web.UI.ScriptControlManager.RegisterExtenderControl(TExtenderControl extenderControl, Control targetControl) +369

Description of error:

EformDateTimeFieldWebControl is a an extended control:

            EformDateTimeFieldWebControl datetime = new EformDateTimeFieldWebControl("Test", "Test", "Test", true, "Test");
            this.Controls.Add(datetime); //Exception

Possible solution:

Don’t know yet.

Maybe I can find the solution here

Security validation for this page is invalid

Exception:

The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.

Possible solution:

You might need to add line

            web.AllowUnsafeUpdates = false;
before the error is thrown.

The End.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: