ADFS 2.0 Sharepoint Event ID 364 error - sharepoint

I'm attempting to configure a Sharepoint server to communicate with ADFS for authentication. I am following the instructions found here: https://technet.microsoft.com/en-us/library/hh305235(v=office15).aspx
When I attempt to open the web page, I recieve an ADFS error. It shows up as an Event ID 364 and gives the following log.
Encountered error during federation passive request.
Additional Data
Exception details:
System.Web.HttpException: Error executing child request for handler 'ASP.homerealmdiscovery_aspx'. ---> System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at HomeRealmDiscovery.Page_Init(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Page.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---
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 ASP.homerealmdiscovery_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
--- End of inner exception stack trace ---
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
at System.Web.HttpServerUtility.Transfer(IHttpHandler handler, Boolean preserveForm)
at Microsoft.IdentityServer.Web.PassiveContext.TransferToASPX(HttpContext context, String path, Boolean preserveViewState)
at Microsoft.IdentityServer.Web.Dispatchers.ClaimsProviderUserInterfaceDispatcher.DispatchInternal(SignInContext context)
at Microsoft.IdentityServer.Web.PassiveProtocolHandler.ProcessRequestInternal(PassiveContext context)
at Microsoft.IdentityServer.Web.PassiveProtocolHandler.ProcessRequest(HttpContext context)
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at HomeRealmDiscovery.Page_Init(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Page.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---
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 ASP.homerealmdiscovery_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
System.NullReferenceException: Object reference not set to an instance of an object.
at HomeRealmDiscovery.Page_Init(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Page.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Can someone help?

Few things you can check:
The Identifier claim for the logged in user is not blank in active directory. For e.g. during configuration PS commands if you set EmailAddress to be the identifier claim, then all users logging in to Sharepoint must have Email adrress associated with them
Logon token expiration should not be 0. Check this at your ADFS server. Below command can be used to Set token lifetime
`Set-AdfsRelyingPartyTrust -TargetName “SharePoint 2013” -TokenLifetime 30`

Related

Added additional fields to custom table in Acumatica has caused error. How to resolve?

We added a number of additional fields to a custom table in Acumatica. One of the fields is causing an error. We made change in SQL Server and updated the code. The field having the error is defined in the code:
#region LastRevisionInventoryID
[PXDBInt]
[PXUIField(DisplayName = "Last Revision Inventory ID")]
public int LastRevisionInventoryID { get; set; }
public class lastRevisionInventoryID : IBqlField{}
#endregion
The code validates and publishes but we get the following error when we try to open the screen after adding the fields to the screen.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
_SetValueByOrdinal(ItemBaseDocument , Int32 , Object ,
PXCacheExtension[] ) +1012
PX.Data.PXCache`1.SetValueByOrdinal(TNode data, Int32 ordinal, Object
value, PXCacheExtension[] extensions) +84
PX.Data.PXCache`1.a(TNode A_0, TNode A_1, IDictionary A_2,
PXCacheOperation A_3, Boolean A_4) +1273
[PXException: Error: An error occurred during processing of the field
LastRevisionInventoryID : Object reference not set to an instance of an
object..]
PX.Data.PXCache`1.a(TNode A_0, TNode A_1, IDictionary A_2,
PXCacheOperation A_3, Boolean A_4) +2908
PX.Data.PXCache`1.a(TNode A_0, TNode A_1, IDictionary A_2,
PXCacheOperation A_3) +87
PX.Data.PXCache`1.Insert(IDictionary values) +237
PX.Data.PXGraph.ExecuteInsert(String viewName, IDictionary values,
Object[] parameters) +187
PX.Web.UI.PXBaseDataSource.a(Object[] A_0, Object[] A_1, String[] A_2,
Boolean[] A_3, PXFilterRow[] A_4, DataSourceSelectArguments A_5) +1783
PX.Web.UI.PXBaseDataSource.ExecuteSelect(String viewName,
DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments)
+13769
PX.Web.UI.PXDataSource.ExecuteSelect(String viewName,
DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments)
+211
PX.Web.UI.PXDataSourceView.Select(DataSourceSelectArguments arguments,
PXDSSelectArguments swarguments, DataSourceViewSelectCallback callback)
+65
PX.Web.UI.PXFormDataProvider.DataBind() +381
PX.Web.UI.PXBoundPanel.PerformSelect() +134
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +138
PX.Web.UI.PXDataViewBar.OnPreRender(EventArgs e) +33
System.Web.UI.Control.PreRenderRecursiveInternal() +162
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Control.PreRenderRecursiveInternal() +256
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+6925
Can anyone help?
In Acumatica, all DAC fields must be of a nullable type, Nullable<int> or int? in your case:
#region LastRevisionInventoryID
public abstract class lastRevisionInventoryID : IBqlField { }
[PXDBInt]
[PXUIField(DisplayName = "Last Revision Inventory ID")]
public int? LastRevisionInventoryID { get; set; }
#endregion

How to properly extend APRegister class in Acumatica

I need to add one bool field to table APPayment. Because APPayment is inherited from APRegister I make extension to class APRegister in the following way:
public class APRegisterExt: PXCacheExtension<APRegister>
{
#region UsrPOAllocated
public abstract class usrPOAllocated : IBqlField
{
}
[PXDBBool]
[PXUIField(DisplayName = "Allocated")]
public bool? UsrPOAllocated{ get; set; }
#endregion
}
but then when I navigate to page AP301000, AP302000 I see following error:
Invalid column name 'UsrPOAllocated'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid column name 'UsrPOAllocated'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Invalid column name 'UsrPOAllocated'.]
PX.Data.PXSqlDatabaseProvider.a(SqlException A_0, IDbCommand A_1) +765
PX.Data.PXSqlDatabaseProvider.ExecuteReaderInternal(IDbCommand command, CommandBehavior behavior) +357
PX.Data.PXSelectResultEnumerator.System.Collections.IEnumerator.MoveNext() +473
PX.Data.PXView.GetResult(Object[] parameters, PXFilterRow[] filters, Boolean reverseOrder, Int32 topCount, PXSearchColumn[] sorts, Boolean& overrideSort, Boolean& extFilter) +6089
PX.Data.PXView.Select(Object[] currents, Object[] parameters, Object[] searches, String[] sortcolumns, Boolean[] descendings, PXFilterRow[] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows) +2651
PX.Data.PXGraph.ExecuteSelect(String viewName, Object[] parameters, Object[] searches, String[] sortcolumns, Boolean[] descendings, PXFilterRow[] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows) +1220
PX.Web.UI.PXBaseDataSource.a(Object[] A_0, Object[] A_1, String[] A_2, Boolean[] A_3, PXFilterRow[] A_4, DataSourceSelectArguments A_5) +218
PX.Web.UI.PXBaseDataSource.ExecuteSelect(String viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments) +13726
PX.Web.UI.PXDataSource.ExecuteSelect(String viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments) +149
PX.Web.UI.PXDataSourceView.Select(DataSourceSelectArguments arguments, PXDSSelectArguments swarguments, DataSourceViewSelectCallback callback) +65
PX.Web.UI.PXFormDataProvider.DataBind() +383
PX.Web.UI.PXBoundPanel.PerformSelect() +135
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +139
PX.Web.UI.PXDataViewBar.OnPreRender(EventArgs e) +33
System.Web.UI.Control.PreRenderRecursiveInternal() +110
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Control.PreRenderRecursiveInternal() +207
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2994
So question is, how to correctly extend classes in Acumatica that is base classes for other entities and implement other interfaces?
And one more question. If I extend base class APRegister, then how to reference in grid additional field with possibility to edit? I mean if I extended APRegister but need to display APPayment elements in grid, then how can I show them with edit option?
Provided code snippet seems to work perfectly fine on a brand new Acumatica website once UsrPOAllocated column was added for the APRegister database table:
public class APRegisterExt : PXCacheExtension<APRegister>
{
#region UsrPOAllocated
public abstract class usrPOAllocated : IBqlField
{
}
[PXDBBool]
[PXUIField(DisplayName = "Allocated")]
public bool? UsrPOAllocated { get; set; }
#endregion
}
Since APInvoice is inherited from APRegister, for every instance of the APInvoice DAC the framework will always initialize all extensions declared for the base APRegister DAC.
Below is a small sample showing how you can access UsrPOAllocated field declared within the APRegister DAC extension inside RowSelected event handler raised for the APInvoice DAC:
public class APInvoiceEntryExt : PXGraphExtension<APInvoiceEntry>
{
public void APInvoice_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
APInvoice invoice = e.Row as APInvoice;
if (invoice == null) return;
var invoiceExt = invoice.GetExtension<APRegisterExt>();
if (invoiceExt.UsrPOAllocated != true)
{
sender.RaiseExceptionHandling<APInvoice.refNbr>(invoice, invoice.RefNbr,
new PXSetPropertyException("Document is not allocated", PXErrorLevel.Warning));
}
else
{
sender.RaiseExceptionHandling<APInvoice.refNbr>(invoice, invoice.RefNbr, null);
}
}
}
The customization from above was created with layout editor:
And this is Aspx, that layout editor generated:
<px:PXCheckBox runat="server" ID="CstPXCheckBox1" DataField="UsrPOAllocated" />

Managing Permissions Issue after SharePoint 2007 to 2013 Migration

I am really struggling with this and any input would be appreciated.
After SharePoint Migration (with the Database Attach method) from 2007->2010->2013 multiple subsites in a sitecollection are having Problems.
Managing Permissions from Site Settings is not possible:
/domain/sitecollection/subsiteA/_layouts/15/people.aspx
/domain/sitecollection/subsiteA/_layouts/15/user.aspx
The Two Pages are Throwing an Error
An unexpected error has occurred:
Log:
Application error when access /_layouts/15/people.aspx, Error=Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at Microsoft.SharePoint.WebControls.ListSiteMapPath.CreateControlHierarchy() at System.Web.UI.WebControls.SiteMapPath.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.WebControls.CompositeControl.get_Controls() at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlB... a042ca9d-e5a1-3092-22c7-5be152697ad2
...yWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalking(Control namingContainer, String id) at Microsoft.SharePoint.WebControls.Menu.set_TemplateId(String value) at Microsoft.SharePoint.WebControls.Menu.InitializeControlIds(Control namingContainerScope) at Microsoft.SharePoint.WebControls.Menu.OnLoad(EventArgs eventArgs) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at Sys... a042ca9d-e5a1-3092-22c7-5be152697ad2
...tem.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) a042ca9d-e5a1-3092-22c7-5be152697ad2
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at Microsoft.SharePoint.WebControls.ListSiteMapPath.CreateControlHierarchy() at System.Web.UI.WebControls.SiteMapPath.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.WebControls.CompositeControl.get_Controls() at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control roo... a042ca9d-e5a1-3092-22c7-5be152697ad2
...tControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalking(Control namingContainer, String id) at Microsoft.SharePoint.WebControls.Menu.set_TemplateId(String value) at Microsoft.SharePoint.WebControls.Menu.InitializeControlIds(Control namingContainerScope) at Microsoft.SharePoint.WebControls.Menu.OnLoad(EventArgs eventArgs) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRe... a042ca9d-e5a1-3092-22c7-5be152697ad2
...cursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) a042ca9d-e5a1-3092-22c7-5be152697ad2
Getting Error Message for Exception System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at Microsoft.SharePoint.WebControls.ListSiteMapPath.CreateControlHierarchy() at System.Web.UI.WebControls.SiteMapPath.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.WebControls.CompositeControl.get_Controls() at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.... a042ca9d-e5a1-3092-22c7-5be152697ad2
...FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalkingInner(Control rootControl, String id) at Microsoft.SharePoint.WebControls.Menu.FindControlByWalking(Control namingContainer, String id) at Microsoft.SharePoint.WebControls.Menu.set_TemplateId(String value) at Microsoft.SharePoint.WebControls.Menu.InitializeControlIds(Control namingContainerScope) at Microsoft.SharePoint.WebControls.Menu.OnLoad(EventArgs eventArgs) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive(... a042ca9d-e5a1-3092-22c7-5be152697ad2
...) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) a042ca9d-e5a1-3092-22c7-5be152697ad2
What I've figured out so far:
Groups are there: -/domain/sitecollection/subsiteA/_layouts/15/people.aspx?MembershipGroupId=3898 throws the same Error.
-/domain/sitecollection/_layouts/15/people.aspx?MembershipGroupId=3898 but direct in sitecollection the group is found
Subsites where permissions are working:
/domain/sitecollection/subsiteB/_layouts/15/people.aspx?MembershipGroupId=6618 is displayed correctly,
but when I change the list view from the Default Detail View to another View, the same error occurs.
I have found the Problem and it was not caused by the Migration, it was caused by a Custom Control (Implemented for the BreadCrumb Navigation).
The Control was Implemented from the Example on the Link,
SiteMapProviders="SPSiteMapProvider,SPXmlContentMapProvider"
The SPXmlContentMapProvider did cause an exception but not always, just when a SiteCollection had a White Space in the URL, and only if you have navigated to the Permission Managing Page.

Null reference exception-control

I get some kind of errors and can't understand why!
[NullReferenceException: Object reference not set to an instance of an object.]
header.Page_Load(Object sender, EventArgs e) +867 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51 System.Web.UI.Control.OnLoad(EventArgs e) +92
IRIPL.Sys5B.Web.cWebPageComponent.OnLoad(EventArgs e) +39 System.Web.UI.Control.LoadRecursive() +54
System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

SPUserCodeSolutionExecutionFailedException

I have a simple sandbox solution with a webpart (which loads data via Linq but thats not the point I think) and everything works fine on my development machine.
When I install this solution on another machine and add the webpart to a page I get the following exception. But I don't know why and what to do and I think its not related to my solution as I can't see any reference to my application in the stack trace.
Any idea?
Web Part Error: Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred.
[SPUserCodeSolutionExecutionFailedException: Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred.]
Server stack trace:
at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext, Boolean shouldUsageLog, Int32 currentProcessId)
at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext, Boolean shouldUsageLog, Int32 currentProcessId)
at Microsoft.SharePoint.UserCode.SPUserCodeAppDomain.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext, Boolean shouldUsageLog, Int32 currentProcessId)
at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcessProxyForShim.ExecuteInternal(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext)
at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcessProxy.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.ExecuteDelegate.EndInvoke(IAsyncResult result)
at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, SPUserToken userToken, String currentAffinity, SPUserCodeExecutionContext executionContext)
at Microsoft.SharePoint.UserCode.SPUserCodePoolableProcessConnection.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, SPUserToken userToken, String affinity, SPUserCodeExecutionContext executionContext)
at Microsoft.SharePoint.UserCode.SPUserCodeExecutionHost.Execute(Type userCodeWrapperType, Guid siteCollectionId, SPUserToken userToken, String affinity, SPUserCodeExecutionContext executionContext)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [1]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.SharePoint.Administration.ISPUserCodeExecutionHostProxy.Execute(Type userCodeWrapperType, Guid siteCollectionId, SPUserToken userToken, String affinityBucketName, SPUserCodeExecutionContext executionContext)
at Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.Execute(Type userCodeWrapperType, SPSite site, SPUserCodeExecutionContext executionContext)
at Microsoft.SharePoint.UserCode.SPUserCodeWebPartRemoteExecutionHelper.<>c_DisplayClassa.b_9()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.UserCode.SPUserCodeWebPartRemoteExecutionHelper.ExecuteRequestInSandBox(HttpContext context, SPWeb web, SPWebPartManager manager, SPUserCodeWebPart userCodeWebPart)
[NullReferenceException: Object reference not set to an instance of an object.]
Server stack trace:
at Microsoft.SharePoint.Utilities.SPThreadContext.get_UserCodeContext()
at Microsoft.SharePoint.Utilities.SPThreadContext.get_Items()
at Microsoft.SharePoint.Utilities.SPThreadContext.Get(String key)
at Microsoft.SharePoint.Utilities.SPThreadContext.GetT
at Microsoft.SharePoint.Library.SPRequest.Dispose(Boolean disposing)
at Microsoft.SharePoint.Library.SPRequest.Dispose()
at Microsoft.SharePoint.SPWeb.InvalidateRequest()
at Microsoft.SharePoint.SPWeb.Invalidate()
at Microsoft.SharePoint.SPWeb.Close()
at Microsoft.SharePoint.SPSite.Close()
at Microsoft.SharePoint.SPSite.Dispose()
at Microsoft.SharePoint.SPSite_SubsetProxy.Dispose__Inner()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.SharePoint.SPSite_SubsetProxy.Dispose()
at Microsoft.SharePoint.SPSite.Dispose__Inner()
at Microsoft.SharePoint.SPSite.Dispose()
at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.Execute(SPUserCodeExecutionContext executionContext)
at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.ExecuteWrapper(SPUserCodeWrapper wrapper, SPUserCodeExecutionContext executionContext)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
Exception rethrown at [1]:
at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.CodeToExecuteWrapper.EndInvoke(IAsyncResult result)
at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext, Boolean shouldUsageLog, Int32 currentProcessId)
Check if sandboxed solutions are enabled (correspoding service is running on your server). Also check if you are actually installing this solution as a sandboxed, not as a regular or vice versa.

Resources