Sandboxed Solution on SharePoint 2013 with Domain Controller – Worked!

Have you tried adding a sandboxed solution to a SharePoint page and get the following error?


And the ULS log looks something like this?

An unknown exception occurred while executing a sandboxed code solution request in the worker process.\r\n|0 – userCodeWrapperType.FullName = “Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper”, userAssemblyGroup = “.UserCodeAssemblyGroupId = “, GroupId = “EE658350464A4B0AB37ADBB899FEA418-p2GIBxqe026W+GAXIcO3HPrvA5gUwRU3Och/MrL+OhM=””, .RootDirectoryPath = “C:\ProgramData\Microsoft\SharePoint\UCCache\8D0670542EFBECB\EE658350464A4B0AB37ADBB899FEA418%2Dp2GIBxqe026W%2BGAXIcO3HPrvA5gUwRU3Och%2547MrL%2BOhM%3D-1″”, siteCollectionId = 0c17a14d-76a7-4b04-930c-53ae6e9f2a06 – Inner Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.Runtime.Remoting.RemotingException: An attempt to connect to the remote activator failed with exception ‘System.Runtime.Remoting.RemotingException: Cannot resolve ‘channel’ template reference: ‘http client’.     at System.Runtime.Remoting.Activation.RemotingXmlConfigFileParser.ReportUnableToResolveTemplateReferenceError(ConfigNode node, String referenceName, RemotingXmlConfigFileData configData)     at System.Runtime.Remoting.Activation.RemotingXmlConfigFileParser.ProcessChannelsChannelNode(ConfigNode node, RemotingXmlConfigFileData configData, Boolean isTemplate)     at System.Runtime.Remoting.Activation.RemotingXmlConfigFileParser.ProcessChannelsNode(ConfigNode node, RemotingXmlConfigFileData configData)     at System.Runtime.Remoting.Activation.RemotingXmlConfigFileParser.ProcessApplicationNode(ConfigNode node, RemotingXmlConfigFileData configData)     at System.Runtime…

These were the symptoms I had on my VM built with all of the essentials to develop SharePoint.  It’s a single VM with Windows Server 2012, Domain Controller, SQL Server 2012, SharePoint 2013, and Visual Studio 2012. I know Microsoft does not support this configuration, but this is the environment I use to do my testing.

After some research via the internet, deciphering the ULS, event log, changing Application Pool identity to an account with higher privilege, and many other attempts to fix this, it continued to fail.

After a couple of hours, I decided to turn on verbose logging for Sandboxed Code Service to see if I could see more information to troubleshoot this error.  I went back to my SharePoint page and attempted to add my “HelloWorld” (sandboxed) Web Part again.  I couldn’t (still can’t) explain it, but it worked.  So I did it a few times just to make sure.


I thought this could not possibly be the “fix”.  So I reset Sandboxed Code Service back to default.  I same error appeared.  I cleared my cache, reset IIS, even rebooted my VM.  Same results…with verbose logging enabled, the Web Part worked…with verbose logging set to default, the Web Part could not be added.

Just to restate, I don’t believe this is the “fix”, but at least it’s a workaround that worked for me.

One last note…

I tested adding a sandboxed solution to an environment where the Domain Controller, SQL Server, and SharePoint are installed on separate servers.  No verbose logging is required to add sandboxed solutions.