This is what the exception I am getting while running an Web project which is migrated from Asp.net to Windows Azure Cloud. If I try to run the ASP.net application it is fine, but after migrating to Windows Azure Cloud I am getting the following exception. There is no clue for me to find a solution, please someon do the needful..
**Exception:**
Server.GetLastError().GetBaseException()
{"Response is not available in this context."}
[System.Web.HttpException]: {"Response is not available in this context."}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
InnerException: null
Message: "Response is not available in this context."
Source: "System.Web"
StackTrace: " at System.Web.UI.Page.get_Response()\r\n at Writehome_aspxToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )\r\n at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declare
dType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at WritePlaceHolderToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )\r\n at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.S
erializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at WriteArrayOfControlToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , Collection
DataContract )\r\n at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDec
laredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at WriteArrayOfanyTypeToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , CollectionDataContract )\r\n at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n a
t System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at WriteSerializableSessionStateStoreDataToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )\r\n at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.NetDataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContract contract, Hashtable surrogateDataContracts)\r\n at System.Runtime.Serialization.NetDataContractSerializer.InternalWr
iteObject(XmlWriterDelegator writer, Object graph)\r\n at System.Runtime.Serialization.XmlObjectSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)\r\n at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)\r\n at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(XmlDictionaryWriter writer, Object graph)\r\n at Microsoft.ApplicationServer.Caching.NetDataContractCacheObjectSerializer.Serialize(Stream stream, Object value)\r\n at Microsoft.ApplicationServer.Caching.DataCacheObjectSerializationProvider.SerializeUserObject(Object userObject, Boolean isCompressionEnabled, ValueFlagsVersion flagsType)\r\n at Microsoft.ApplicationServer.Caching.SocketClientProtocol.SerializeValue(Object obj)\r\n at Microsoft.ApplicationServer.Caching.SocketClientProtocol.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle,
TimeSpan timeout, DataCacheTag[] tags, String region, IMonitoringListener listener)\r\n at Microsoft.ApplicationServer.Caching.DataCache.InternalPutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout, DataCacheTag[] tags, String region, IMonitoringListener listener)\r\n at Microsoft.ApplicationServer.Caching.DataCache.<>c__DisplayClass9c.<PutAndUnlock>b__9b()\r\n at Microsoft.ApplicationServer.Caching.MonitoringListenerFactory.EmptyListener.Microsoft.ApplicationServer.Caching.IMonitoringListener.Listen[TResult](Func`1 innerDelegate)\r\n at Microsoft.ApplicationServer.Caching.DataCache.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout)\r\n at Microsoft.Web.DistributedCache.DataCacheWrapper.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout)\r\n at Microsoft.Web.DistributedCache.DataCacheForwarderBase.<>c__DisplayClass1c.<PutAndUnlock>b__1b()\r\n at Microsoft.Web.DistributedCache.DataCacheFo
rwarderBase.<>c__DisplayClass31`1.<PerformCacheOperation>b__30()\r\n at Microsoft.Web.DistributedCache.DataCacheRetryWrapper.PerformCacheOperation(Action action)\r\n at Microsoft.Web.DistributedCache.DataCacheForwarderBase.PerformCacheOperation[TResult](Func`1 func)\r\n at Microsoft.Web.DistributedCache.DataCacheForwarderBase.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout)\r\n at Microsoft.Web.DistributedCache.BlobBasedSessionStoreProvider.SetAndReleaseItemExclusive(HttpContextBase context, String id, SessionStateStoreData item, Object lockId, Boolean newItem)\r\n at Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem)\r\n at System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs)\r\n at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Exec
ute()\r\n at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)"
TargetSite: {System.Web.HttpResponse get_Response()}
It happens if you try to do Azure stuff like accessing the blob in the Application_Start method.
It was because HttpContext.Current.Response was accessible.Azure uses the Response object for logging. In any case, if you need to access the blob in your web app or do any other Azure stuff AND want to do this even though there is not a Response object, like in the Application_Start method. You simply set HttpContext.Current to null, but in a smart way.
Application_Start is as below
protected void Application_Start(object sender, EventArgs e)
{
CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetter) =>
{
configSetter(RoleEnvironment.GetConfigurationSettingValue(configName));
});
using (new AzureContext())
{
CloudStorageAccount storageAccount = CloudStorageAccount.FromConfigurationSetting("BlobConnectionString");
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");
container.CreateIfNotExist();
container.FetchAttributes();
}
}
AzureContext is as below :
public class AzureContext : IDisposable
{
HttpContext _oldHttpContext;
bool _restoreOldHttpContext = false;
public AzureContext(bool forceSettingContextToNull = false)
{
if (forceSettingContextToNull)
{
_oldHttpContext = HttpContext.Current;
HttpContext.Current = null;
_restoreOldHttpContext = true;
}
else
{
try
{
HttpResponse response = HttpContext.Current.Response;
}
catch (HttpException)
{
_oldHttpContext = HttpContext.Current;
HttpContext.Current = null;
_restoreOldHttpContext = true;
}
}
}
public void Dispose(bool disposing)
{
if (disposing)
{
if (_restoreOldHttpContext)
{
HttpContext.Current = _oldHttpContext;
}
}
}
public void Dispose()
{
Dispose(true);
}
~AzureContext()
{
Dispose(false);
}
}
For more information check this out Azure and Response is not available in this context
I hope this will help to you.
I suffered because of this issue... You can resolve this issue by applying this patch...
http://support.microsoft.com/kb/2468871
I had applied this patch in my local environment and as well as in the cloud environment (using startup role). But you may not need to patch the cloud environment now because they might updated. You can contact Azure support( India : 1-(866) 676-6546) regarding this issue if the issues is still exist in the cloud, They will help you with applying the patch.
Thank for all your help, finnally i have found out the reason for the issue. Issue occured because I was trying to store the the System.Web.UI.WebControls into a session.
Since not all System.Web.UI.WebControls are serilizable, so avoid storind WebControls to session.
Happy coding..
Related
I have been trying to test my gms2 project on an android emulator from android studio. I first set up the sdk, using this article as a guide https:
//help.yoyogames.com/hc/en-us/articles/115001368727-Setting-Up-For-Android-or-Amazon-Fire
Then, I used this article:
https://help.yoyogames.com/hc/en-us/articles/115000270191-Android-Setting-Up-Virtual-Devices
to set up virtual android devices. One thing I did note when doing this was that the HAXM installer failed every time, this is what I saw
For more details, please check the installation log: C:\Users\GRAHAM~1\AppData\Local\Temp\haxm_install-20210917_0928.log
IntelĀ® HAXM installation failed. To install IntelĀ® HAXM follow the instructions found at: https://github.com/intel/haxm/wiki/Installation-Instructions-on-Windows
Done
This is what I saw on the SDK manager
This may be related, I'm not sure. But then, I went into gms2 and followed everything in the articles, but when I tried to run the project, I got the following output:
System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
at System.Xml.XmlTextReaderImpl.ReadData()
at System.Xml.XmlTextReaderImpl.SwitchEncoding(Encoding newEncoding)
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at GMAssetCompiler.TexturePage.(String )
at GMAssetCompiler.TexturePage.(String , Boolean , Boolean , Boolean , Boolean , Int32 , String , String , String[] )
at GMAssetCompiler.WADSaver`1.<>c.(KeyValuePair`2 )
at GMAssetCompiler.Program..(Object )
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
at System.Xml.XmlTextReaderImpl.ReadData()
at System.Xml.XmlTextReaderImpl.SwitchEncoding(Encoding newEncoding)
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at GMAssetCompiler.TexturePage.(String )
at GMAssetCompiler.TexturePage.(String , Boolean , Boolean , Boolean , Boolean , Int32 , String , String , String[] )
at GMAssetCompiler.WADSaver`1.<>c.(KeyValuePair`2 )
at GMAssetCompiler.Program..(Object )
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
at System.Xml.XmlTextReaderImpl.ReadData()
at System.Xml.XmlTextReaderImpl.SwitchEncoding(Encoding newEncoding)
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at GMAssetCompiler.TexturePage.(String )
at GMAssetCompiler.TexturePage.(String , Boolean , Boolean , Boolean , Boolean , Int32 , String , String , String[] )
at GMAssetCompiler.WADSaver`1.<>c.(KeyValuePair`2 )
at GMAssetCompiler.Program..(Object )
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
-----------------------------------------------------------------------------
System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
at System.Xml.XmlTextReaderImpl.ReadData()
at System.Xml.XmlTextReaderImpl.SwitchEncoding(Encoding newEncoding)
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at GMAssetCompiler.TexturePage.(String )
at GMAssetCompiler.TexturePage.(String , Boolean , Boolean , Boolean , Boolean , Int32 , String , String , String[] )
at GMAssetCompiler.WADSaver`1.<>c.(KeyValuePair`2 )
at GMAssetCompiler.Program..(Object )
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
at System.Xml.XmlTextReaderImpl.ReadData()
at System.Xml.XmlTextReaderImpl.SwitchEncoding(Encoding newEncoding)
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at GMAssetCompiler.TexturePage.(String )
at GMAssetCompiler.TexturePage.(String , Boolean , Boolean , Boolean , Boolean , Int32 , String , String , String[] )
at GMAssetCompiler.WADSaver`1.<>c.(KeyValuePair`2 )
at GMAssetCompiler.Program..(Object )
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
at System.Xml.XmlTextReaderImpl.ReadData()
at System.Xml.XmlTextReaderImpl.SwitchEncoding(Encoding newEncoding)
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at GMAssetCompiler.TexturePage.(String )
at GMAssetCompiler.TexturePage.(String , Boolean , Boolean , Boolean , Boolean , Int32 , String , String , String[] )
at GMAssetCompiler.WADSaver`1.<>c.(KeyValuePair`2 )
at GMAssetCompiler.Program..(Object )
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
at System.Xml.XmlTextReaderImpl.ReadData()
at System.Xml.XmlTextReaderImpl.SwitchEncoding(Encoding newEncoding)
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at GMAssetCompiler.TexturePage.(String )
at GMAssetCompiler.TexturePage.(String , Boolean , Boolean , Boolean , Boolean , Int32 , String , String , String[] )
at GMAssetCompiler.WADSaver`1.<>c.(KeyValuePair`2 )
at GMAssetCompiler.Program..(Object )
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
-----------------------------------------------------------------------------
System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
at System.Xml.XmlTextReaderImpl.ReadData()
at System.Xml.XmlTextReaderImpl.SwitchEncoding(Encoding newEncoding)
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at GMAssetCompiler.TexturePage.(String )
at GMAssetCompiler.TexturePage.(String , Boolean , Boolean , Boolean , Boolean , Int32 , String , String , String[] )
at GMAssetCompiler.WADSaver`1.<>c.(KeyValuePair`2 )
at GMAssetCompiler.Program..(Object )
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
-----------------------------------------------------------------------------
EXCEPTION FILE - C:\Users\GRAHAMJT20\AppData\Local\Temp\a839beeab34845389c4d01131e83e7cd.yyg.saencryptedreport
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
EXCEPTION FILE - C:\Users\GRAHAMJT20\AppData\Local\Temp\02db8f82f77e49a5a8414617cce166e6.yyg.saencryptedreport
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
EXCEPTION FILE - C:\Users\GRAHAMJT20\AppData\Local\Temp\b040736233304be79cc6c2d2c53ad089.yyg.saencryptedreport
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
EXCEPTION FILE - C:\Users\GRAHAMJT20\AppData\Local\Temp\27f7125ae7a047debcc5b7463282ace9.yyg.saencryptedreport
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
EXCEPTION FILE - C:\Users\GRAHAMJT20\AppData\Local\Temp\ef897878cf614509afbba924f24b0806.yyg.saencryptedreport
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
EXCEPTION FILE - C:\Users\GRAHAMJT20\AppData\Local\Temp\bcd410e5ac854919bb7b9486c6f6866c.yyg.saencryptedreport
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
EXCEPTION FILE - C:\Users\GRAHAMJT20\AppData\Local\Temp\5f27bb810dc041b9b7b79c4c98eab7ed.yyg.saencryptedreport
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
at System.Xml.XmlTextReaderImpl.ReadData()
at System.Xml.XmlTextReaderImpl.SwitchEncoding(Encoding newEncoding)
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at GMAssetCompiler.TexturePage.(String )
at GMAssetCompiler.TexturePage.(String , Boolean , Boolean , Boolean , Boolean , Int32 , String , String , String[] )
at GMAssetCompiler.WADSaver`1.<>c.(KeyValuePair`2 )
at GMAssetCompiler.Program..(Object )
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
at System.Xml.XmlTextReaderImpl.ReadData()
at System.Xml.XmlTextReaderImpl.SwitchEncoding(Encoding newEncoding)
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at GMAssetCompiler.TexturePage.(String )
at GMAssetCompiler.TexturePage.(String , Boolean , Boolean , Boolean , Boolean , Int32 , String , String , String[] )
at GMAssetCompiler.WADSaver`1.<>c.(KeyValuePair`2 )
at GMAssetCompiler.Program..(Object )
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
This is all a bit over my head to be honest. Any help getting this to work would be appreciated.
(There was more to the error output that I can provide if needed, it was too long to put here though)
I have a C# solution containing Postsharp v3, Resharper 8, Redgate SqlBundle and .Net toolbet + some very large T4 template generated code.
When generating code from templates and attempting to open them up a folder on my hard disk ..\AppData\Local\Red Gate\Logs\SQL Connect 1* fills up with 50 MB log files every 4 or 5 seconds. All with very similar content.
14:49:01.331|Trace |g.TraceLoggerAdapter|1 |#1:devenv.exe Information: 0 : at at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at RedGate.SQLConnect.VsPackage.Logging.TraceLoggerAdapter.WriteLine(String message)
at RedGate.SQLConnect.VsPackage.Logging.TraceLoggerAdapter.Write(String message)
at System.Diagnostics.TraceListener.WriteHeader(String source, TraceEventType eventType, Int32 id)
at System.Diagnostics.TraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String format, Object[] args)
at System.Diagnostics.TraceInternal.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args)
at PostSharp.VisualStudio.Services.Language.CodeParsingService.CodeElementVisitor.PostSharp.VisualStudio.Services.Language.ICodeElementVisitor.VisitCodeElement(String codeElementName, CodeElement codeElement, String semantic, ICodeLocator codeLocator)
at PostSharp.VisualStudio.Services.Language.CSharp.CSharpLanguageAdapter.VisitCodeProperty(CodeProperty codeProperty, String parentName, ICodeElementVisitor activator)
at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, String parentName, ICodeElementVisitor activator)
at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeType(CodeType codeType, ICodeElementVisitor activator)
at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, String parentName, ICodeElementVisitor activator)
at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, String parentName, ICodeElementVisitor activator)
at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, ICodeElementVisitor visitor)
at PostSharp.VisualStudio.Services.Language.CodeParsingService.GetEnhancedCodeElements(FileCodeModel fileCodeModel)
at PostSharp.VisualStudio.View.Markers.TextMarkerLayer.ScanSnapshot(ITextSnapshot textSnapshot)
at PostSharp.VisualStudio.View.Markers.TextMarkerLayer.AddAdornments()
at PostSharp.VisualStudio.View.Markers.TextMarkerLayer.OnLayoutChangedDelayed(Object sender, EventArgs e)
at PostSharp.VisualStudio.View.QuietPeriodTimer.OnTick(Object sender, EventArgs e)
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
14:49:01.331|Trace |g.TraceLoggerAdapter|1 |#1:Scanning code element Petex.DP.Service.Requests.DpObject_GetDpObjectAllContainingRequest.RelatedToIDs of type vsCMElementProperty. at at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at RedGate.SQLConnect.VsPackage.Logging.TraceLoggerAdapter.WriteLine(String message)
at System.Diagnostics.TraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String format, Object[] args)
at System.Diagnostics.TraceInternal.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args)
at PostSharp.VisualStudio.Services.Language.CodeParsingService.CodeElementVisitor.PostSharp.VisualStudio.Services.Language.ICodeElementVisitor.VisitCodeElement(String codeElementName, CodeElement codeElement, String semantic, ICodeLocator codeLocator)
at PostSharp.VisualStudio.Services.Language.CSharp.CSharpLanguageAdapter.VisitCodeProperty(CodeProperty codeProperty, String parentName, ICodeElementVisitor activator)
at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, String parentName, ICodeElementVisitor activator)
at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeType(CodeType codeType, ICodeElementVisitor activator)
at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, String parentName, ICodeElementVisitor activator)
at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, String parentName, ICodeElementVisitor activator)
at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, ICodeElementVisitor visitor)
at PostSharp.VisualStudio.Services.Language.CodeParsingService.GetEnhancedCodeElements(FileCodeModel fileCodeModel)
at PostSharp.VisualStudio.View.Markers.TextMarkerLayer.ScanSnapshot(ITextSnapshot textSnapshot)
at PostSharp.VisualStudio.View.Markers.TextMarkerLayer.AddAdornments()
at PostSharp.VisualStudio.View.Markers.TextMarkerLayer.OnLayoutChangedDelayed(Object sender, EventArgs e)
at PostSharp.VisualStudio.View.QuietPeriodTimer.OnTick(Object sender, EventArgs e)
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
Any ideas how to stop this as its crippling my dev environment?
This is caused by the combination of the PostSharp and Redgate behaviors.
PostSharp produces trace messages periodically and they are not written to any file normally. You can see the messages only if you enable the diagnostics window in the advanced PostSharp options.
Redgate on the other hand installs trace listeners that catch messages including those produced by the PostSharp and write them to the log files, on top of that it seems to add a stack trace to each message (even if it's not an exception).
It's an unfortunate combination of factors. As for the PostSharp, there's a fix scheduled that will disable tracing completely unless user enables diagnostics window explicitly.
My application was migrated from ASP.net to Azure. While running in the Compute Emulator it gives the following exception:
Server.GetLastError().GetBaseException()
{"Response is not available in this context."}
[System.Web.HttpException]: {"Response is not available in this context."}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
InnerException: null
Message: "Response is not available in this context."
Source: "System.Web"
StackTrace: " at System.Web.UI.Page.get_Response()\r\n at Writehome_aspxToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )\r\n at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declare
dType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at WritePlaceHolderToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )\r\n at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.S
erializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at WriteArrayOfControlToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , Collection
DataContract )\r\n at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDec
laredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at WriteArrayOfanyTypeToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , CollectionDataContract )\r\n at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n a
t System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at WriteSerializableSessionStateStoreDataToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )\r\n at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.NetDataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContract contract, Hashtable surrogateDataContracts)\r\n at System.Runtime.Serialization.NetDataContractSerializer.InternalWr
iteObject(XmlWriterDelegator writer, Object graph)\r\n at System.Runtime.Serialization.XmlObjectSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)\r\n at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)\r\n at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(XmlDictionaryWriter writer, Object graph)\r\n at Microsoft.ApplicationServer.Caching.NetDataContractCacheObjectSerializer.Serialize(Stream stream, Object value)\r\n at Microsoft.ApplicationServer.Caching.DataCacheObjectSerializationProvider.SerializeUserObject(Object userObject, Boolean isCompressionEnabled, ValueFlagsVersion flagsType)\r\n at Microsoft.ApplicationServer.Caching.SocketClientProtocol.SerializeValue(Object obj)\r\n at Microsoft.ApplicationServer.Caching.SocketClientProtocol.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle,
TimeSpan timeout, DataCacheTag[] tags, String region, IMonitoringListener listener)\r\n at Microsoft.ApplicationServer.Caching.DataCache.InternalPutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout, DataCacheTag[] tags, String region, IMonitoringListener listener)\r\n at Microsoft.ApplicationServer.Caching.DataCache.<>c__DisplayClass9c.<PutAndUnlock>b__9b()\r\n at Microsoft.ApplicationServer.Caching.MonitoringListenerFactory.EmptyListener.Microsoft.ApplicationServer.Caching.IMonitoringListener.Listen[TResult](Func`1 innerDelegate)\r\n at Microsoft.ApplicationServer.Caching.DataCache.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout)\r\n at Microsoft.Web.DistributedCache.DataCacheWrapper.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout)\r\n at Microsoft.Web.DistributedCache.DataCacheForwarderBase.<>c__DisplayClass1c.<PutAndUnlock>b__1b()\r\n at Microsoft.Web.DistributedCache.DataCacheFo
rwarderBase.<>c__DisplayClass31`1.<PerformCacheOperation>b__30()\r\n at Microsoft.Web.DistributedCache.DataCacheRetryWrapper.PerformCacheOperation(Action action)\r\n at Microsoft.Web.DistributedCache.DataCacheForwarderBase.PerformCacheOperation[TResult](Func`1 func)\r\n at Microsoft.Web.DistributedCache.DataCacheForwarderBase.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout)\r\n at Microsoft.Web.DistributedCache.BlobBasedSessionStoreProvider.SetAndReleaseItemExclusive(HttpContextBase context, String id, SessionStateStoreData item, Object lockId, Boolean newItem)\r\n at Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem)\r\n at System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs)\r\n at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Exec
ute()\r\n at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)"
TargetSite: {System.Web.HttpResponse get_Response()}
So I tried by deploying it in the Azure Subscription withe IntelliTrace log, So it show the following exception,
System.Web.HttpException
Invalid file name for file monitoring: 'E:\sitesroot\0\CustomControls'. Common reasons for failure include:
The filename is not a valid Win32 file name.
The filename is not a absolute path.
The filename contains wildcard characters.
The file specified is a directory.
Access denied.
Invalid file name for file monitoring: 'E:\sitesroot\0\MasterPages. Common reasons for failure include:
The filename is not a valid Win32 file name.
The filename is not a absolute path.
The filename contains wildcard characters.
The file specified is a directory.
Access denied.
as per this link
Not a solution at all, But Clearing all my temp files
C:\Windows\Microsoft.NET\Framework\v4\Temporary ASP.NET Files (or
something close enough) - might work
Christian's answer in the comments above worked for me. And I'm not even using Azure, just trying to debug an asp.net mvc4 project.
Having 'Enable Just My Code' under Tools/Options/Debugging/General checked made it disappear in my case.
Clearing the temp files did not work for me as there were no temp files in that folder...lol! Having the API not throw exceptions from System.Web.HttpException is a work around, however these errors are still there eating up processes in the background. It's really bad practice to sweep bugs under the rug.
found this related post on stackoverflow which may help
This is what the exception I am getting while running an Web project which is migrated from Asp.net to Windows Azure Cloud. That too working fine if the sessionstate in web.config
<sessionState mode="InProc" cookieless="false" timeout="30" />.
But if i make the web.config sessionstate to
<sessionState mode="Custom" customProvider="AzureCacheSessionStoreProvider" >
<providers>
<add name="AzureCacheSessionStoreProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="default" useBlobMode="true" dataCacheClientName="default"/>
</providers>
</sessionState>
it is giving the the following exception. There is no clue regarding the exception. Please someone help at the earliest.
Exception:
{"Response is not available in this context."}
[System.Web.HttpException]: {"Response is not available in this context."}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
InnerException: null
Message: "Response is not available in this context."
Source: "System.Web"
StackTrace: " at System.Web.UI.Page.get_Response()\r\n at Writehome_aspxToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )\r\n at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declare
dType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at WritePlaceHolderToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )\r\n at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.S
erializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at WriteArrayOfControlToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , Collection
DataContract )\r\n at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDec
laredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at WriteArrayOfanyTypeToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , CollectionDataContract )\r\n at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)\r\n a
t System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n at WriteSerializableSessionStateStoreDataToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )\r\n at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n at System.Runtime.Serialization.NetDataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContract contract, Hashtable surrogateDataContracts)\r\n at System.Runtime.Serialization.NetDataContractSerializer.InternalWr
iteObject(XmlWriterDelegator writer, Object graph)\r\n at System.Runtime.Serialization.XmlObjectSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)\r\n at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)\r\n at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(XmlDictionaryWriter writer, Object graph)\r\n at Microsoft.ApplicationServer.Caching.NetDataContractCacheObjectSerializer.Serialize(Stream stream, Object value)\r\n at Microsoft.ApplicationServer.Caching.DataCacheObjectSerializationProvider.SerializeUserObject(Object userObject, Boolean isCompressionEnabled, ValueFlagsVersion flagsType)\r\n at Microsoft.ApplicationServer.Caching.SocketClientProtocol.SerializeValue(Object obj)\r\n at Microsoft.ApplicationServer.Caching.SocketClientProtocol.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle,
TimeSpan timeout, DataCacheTag[] tags, String region, IMonitoringListener listener)\r\n at Microsoft.ApplicationServer.Caching.DataCache.InternalPutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout, DataCacheTag[] tags, String region, IMonitoringListener listener)\r\n at Microsoft.ApplicationServer.Caching.DataCache.<>c__DisplayClass9c.<PutAndUnlock>b__9b()\r\n at Microsoft.ApplicationServer.Caching.MonitoringListenerFactory.EmptyListener.Microsoft.ApplicationServer.Caching.IMonitoringListener.Listen[TResult](Func`1 innerDelegate)\r\n at Microsoft.ApplicationServer.Caching.DataCache.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout)\r\n at Microsoft.Web.DistributedCache.DataCacheWrapper.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout)\r\n at Microsoft.Web.DistributedCache.DataCacheForwarderBase.<>c__DisplayClass1c.<PutAndUnlock>b__1b()\r\n at Microsoft.Web.DistributedCache.DataCacheFo
rwarderBase.<>c__DisplayClass31`1.<PerformCacheOperation>b__30()\r\n at Microsoft.Web.DistributedCache.DataCacheRetryWrapper.PerformCacheOperation(Action action)\r\n at Microsoft.Web.DistributedCache.DataCacheForwarderBase.PerformCacheOperation[TResult](Func`1 func)\r\n at Microsoft.Web.DistributedCache.DataCacheForwarderBase.PutAndUnlock(String key, Object value, DataCacheLockHandle lockHandle, TimeSpan timeout)\r\n at Microsoft.Web.DistributedCache.BlobBasedSessionStoreProvider.SetAndReleaseItemExclusive(HttpContextBase context, String id, SessionStateStoreData item, Object lockId, Boolean newItem)\r\n at Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem)\r\n at System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs)\r\n at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Exec
ute()\r\n at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)"
TargetSite: {System.Web.HttpResponse get_Response()}
Thank for all your help, finnally i have found out the reason for the issue. Issue occured because I was trying to store the the System.Web.UI.WebControls into a session.
Since not all System.Web.UI.WebControls are serilizable, so avoid storind WebControls to session.
Happy coding..
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.