I am getting a messagebox saying "Attempted to access an unloaded appdomain. (Exception from HRESULT:0x80131014)" when I open the report preview screen.
Here is the debugger output:
[Microsoft.LightSwitch.DataService][Application:Information][LightSwitchServiceApplication.XtraReportsServiceData:SaveChanges] Executing 'SaveChanges'
[Microsoft.LightSwitch.UserCode][Application:Information][XtraReportsServiceData:SaveChanges:CanExecute] Invoking user method: XtraReportsServiceDataService.SaveChanges_CanExecute
[Microsoft.LightSwitch.UserCode][Application:Verbose][XtraReportsServiceData:SaveChanges:CanExecute] A user implemented method does not exist.
[Microsoft.LightSwitch.UserCode][Application:Information][XtraReportsServiceData:SaveChanges:CanExecute] CanExecute returned 'True'.
[Microsoft.LightSwitch.UserCode][Application:Information][XtraReportsServiceData:SaveChanges:Executing] Invoking user method: XtraReportsServiceDataService.SaveChanges_Executing
[Microsoft.LightSwitch.UserCode][Application:Verbose][XtraReportsServiceData:SaveChanges:Executing] A user implemented method does not exist.
[Microsoft.LightSwitch.UserCode][Application:Information][XtraReportsServiceData:SaveChanges:Executing] Execution completed.
[Microsoft.LightSwitch.DataService][Application:Information][LightSwitchServiceApplication.XtraReportsServiceData:SaveChanges] DataService Submit Request
1 inserted entities
Added: LightSwitchApplication.MessageEnvelope(0)(Key: Id=0)(Properties: Id=0 | RowVersion=0 | Message=System.Byte[])
[Microsoft.LightSwitch.UserCode][Application:Information][XtraReportsServiceData:MessageEnvelopes:CanInsert] Invoking user method: XtraReportsServiceDataService.MessageEnvelopes_CanInsert
[Microsoft.LightSwitch.UserCode][Application:Verbose][XtraReportsServiceData:MessageEnvelopes:CanInsert] A user implemented method does not exist.
[Microsoft.LightSwitch.UserCode][Application:Information][XtraReportsServiceData:MessageEnvelopes:CanInsert] CanInsert returned 'True'.
[Microsoft.LightSwitch.UserCode][Application:Information][MessageEnvelope:Id:Validate] Invoking user method: MessageEnvelope.Id_Validate
[Microsoft.LightSwitch.UserCode][Application:Verbose][MessageEnvelope:Id:Validate] A user implemented method does not exist.
[Microsoft.LightSwitch.UserCode][Application:Information][MessageEnvelope:Id:Validate] Execution completed.
[Microsoft.LightSwitch.UserCode][Application:Information][MessageEnvelope:RowVersion:Validate] Invoking user method: MessageEnvelope.RowVersion_Validate
[Microsoft.LightSwitch.UserCode][Application:Verbose][MessageEnvelope:RowVersion:Validate] A user implemented method does not exist.
[Microsoft.LightSwitch.UserCode][Application:Information][MessageEnvelope:RowVersion:Validate] Execution completed.
[Microsoft.LightSwitch.UserCode][Application:Information][MessageEnvelope:Message:Validate] Invoking user method: MessageEnvelope.Message_Validate
[Microsoft.LightSwitch.UserCode][Application:Verbose][MessageEnvelope:Message:Validate] A user implemented method does not exist.
[Microsoft.LightSwitch.UserCode][Application:Information][MessageEnvelope:Message:Validate] Execution completed.
[Microsoft.LightSwitch.UserCode][Application:Information][LightSwitchServiceApplication.XtraReportsServiceData:Validate] Invoking user method: XtraReportsServiceDataService.MessageEnvelope_Validate
[Microsoft.LightSwitch.UserCode][Application:Verbose][LightSwitchServiceApplication.XtraReportsServiceData:Validate] A user implemented method does not exist.
[Microsoft.LightSwitch.UserCode][Application:Information][LightSwitchServiceApplication.XtraReportsServiceData:Validate] Execution completed.
[Microsoft.LightSwitch.UserCode][Application:Information][XtraReportsServiceData:MessageEnvelopes:Inserting] Invoking user method: XtraReportsServiceDataService.MessageEnvelopes_Inserting for LightSwitchApplication.MessageEnvelope(0)(Key: Id=0)
[Microsoft.LightSwitch.UserCode][Application:Verbose][XtraReportsServiceData:MessageEnvelopes:Inserting] A user implemented method does not exist.
[Microsoft.LightSwitch.UserCode][Application:Information][XtraReportsServiceData:MessageEnvelopes:Inserting] Execution completed.
[Microsoft.LightSwitch.DataService][Application:Information][LightSwitchServiceApplication.XtraReportsServiceData:SaveChanges] DataProvider Submit Request
1 inserted entities
Added: LightSwitchApplication.MessageEnvelope(0)(Key: Id=0)(Properties: Id=0 | RowVersion=0 | Message=System.Byte[])
The thread '<No Name>' (0x14a8) has exited with code 0 (0x0).
The thread '<No Name>' (0x14c8) has exited with code 0 (0x0).
[Microsoft.LightSwitch.DataService][Application:Error][LightSwitchServiceApplication.XtraReportsServiceData:SaveChanges] An exception has occurred: Microsoft.LightSwitch.DataServiceOperationException: Attempted to access an unloaded appdomain. (Exception from HRESULT: 0x80131014) —> System.AppDomainUnloadedException: Attempted to access an unloaded appdomain. (Exception from HRESULT: 0x80131014)
at System.StubHelpers.StubHelpers.InternalGetCOMHRExceptionObject(Int32 hr, IntPtr pCPCMD, Object pThis, Boolean fForWinRT)
at System.StubHelpers.StubHelpers.GetCOMHRExceptionObject(Int32 hr, IntPtr pCPCMD, Object pThis)
at System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32 propgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier, Guid& transactionIdentifier, OletxTransactionIsolationLevel& isolationLevel, ITransactionShim& transactionShim)
at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken)
at System.Transactions.TransactionStatePSPEOperation.PSPEPromote(InternalTransaction tx)
at System.Transactions.TransactionStateDelegatedBase.EnterState(InternalTransaction tx)
at System.Transactions.EnlistableStates.Promote(InternalTransaction tx)
at System.Transactions.Transaction.Promote()
at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transaction transaction)
at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
at System.Data.SqlClient.SqlInternalConnection.GetTransactionCookie(Transaction transaction, Byte[] whereAbouts)
at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)
at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)
at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction)
at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at DevExpress.Xpo.DB.ConnectionProviderSql…ctor(IDbConnection connection, AutoCreateOption autoCreateOption)
at DevExpress.Xpo.DB.MSSqlConnectionProvider…ctor(IDbConnection connection, AutoCreateOption autoCreateOption)
at DevExpress.Xpo.DB.MSSqlConnectionProvider.CreateProviderFromConnection(IDbConnection connection, AutoCreateOption autoCreateOption)
at DevExpress.Xpo.DB.MSSqlConnectionProvider.CreateProviderFromString(String connectionString, AutoCreateOption autoCreateOption, IDisposable[]& objectsToDisposeOnDisconnect)
at DevExpress.Xpo.DB.DataStoreBase.QueryDataStore(String providerType, String connectionString, AutoCreateOption defaultAutoCreateOption, IDisposable[]& objectsToDisposeOnDisconnect)
at DevExpress.Xpo.XpoDefault.GetConnectionProvider(String connectionString, AutoCreateOption defaultAutoCreateOption, IDisposable[]& objectsToDisposeOnDisconnect)
at DevExpress.Xpo.DB.DataStorePool.CreateProvider()
at DevExpress.Xpo.DB.DataStorePool.AcquireChangeProvider()
at DevExpress.Xpo.DB.DataStoreForkBase.AcquireUpdateSchemaProvider()
at DevExpress.Xpo.DB.DataStoreForkBase.UpdateSchema(Boolean dontCreateIfFirstTableNotExist, DBTable[] tables)
at DevExpress.Xpo.ThreadSafeDataLayer.UpdateSchema(Boolean dontCreate, XPClassInfo[] types)
at DevExpress.Xpo.SimpleObjectLayer.UpdateSchema(Boolean dontCreateIfFirstTableNotExist, XPClassInfo[] types)
at DevExpress.Xpo.Session.UpdateSchema(Boolean dontCreateIfFirstTableNotExist, XPClassInfo[] types)
at DevExpress.Xpo.Helpers.ObjectCollectionLoader.PrepareLoadObjects(ObjectsQuery[] queries)
at DevExpress.Xpo.Helpers.ObjectCollectionLoader.LoadObjects(ObjectsQuery[] queries)
at DevExpress.Xpo.SimpleObjectLayer.LoadObjects(Session session, ObjectsQuery[] queries)
at DevExpress.Xpo.Session.GetObjectsInternal(ObjectsQuery[] queries)
at DevExpress.Xpo.Session.<>c__DisplayClasse.<GetObjects>b__c()
at DevExpress.Xpo.Logger.LogManager.Log[T](String category, LogHandler`1 handler, MessageHandler`1 createMessageHandler)
at DevExpress.Xpo.Session.GetObjects(ObjectsQuery[] queries)
at DevExpress.Xpo.Session.GetObjects(ObjectsQuery query)
at DevExpress.Xpo.Session.GetObjects(XPClassInfo classInfo, CriteriaOperator criteria, SortingCollection sorting, Int32 skipSelectedRecords, Int32 topSelectedRecords, Boolean selectDeleted, Boolean force)
at DevExpress.Xpo.Session.GetObjects(XPClassInfo classInfo, CriteriaOperator criteria, SortingCollection sorting, Int32 topSelectedRecords, Boolean selectDeleted, Boolean force)
at DevExpress.Xpo.Helpers.XPObjectTypesManager.GetAllTypes()
at DevExpress.Xpo.Helpers.XPObjectTypesManager.EnsureIsTypedObjectValid()
at DevExpress.Xpo.ThreadSafeDataLayer.BeforeClassInfoSubscribe()
at DevExpress.Xpo.Helpers.BaseDataLayer…ctor(XPDictionary dictionary, IDataStore provider, Assembly[] persistentObjectsAssemblies)
at DevExpress.Xpo.ThreadSafeDataLayer…ctor(XPDictionary dictionary, IDataStore provider, Assembly[] persistentObjectsAssemblies)
at DevExpress.Xpf.Printing.Service.Native.Services.DALUtilityService.<.ctor>b__1()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at DevExpress.Xpf.Printing.Service.Native.Services.DALUtilityService.get_DataLayer()
at DevExpress.Xpf.Printing.Service.Native.Services.DALUtilityService.CreateTransactionDALSession()
at DevExpress.Xpf.Printing.Service.Native.Services.DALUtilityService.SafeInitialize()
at DevExpress.Xpf.Printing.Service.ExportService…ctor(IServiceProvider serviceProvider)
at DevExpress.XtraReports.Service.ReportService…ctor(IServiceProvider serviceProvider)
at DevExpress.XtraReports.LightSwitch.Server.Native.ReportServiceInvoker.Invoke(MessageEnvelope messageEnvelope)
at DevExpress.XtraReports.LightSwitch.Server.XtraReportsService.InsertMessageEnvelope(MessageEnvelope envelope)
at InsertMessageEnvelope(DomainService , Object[] )
at System.ServiceModel.DomainServices.Server.ReflectionDomainServiceDescriptionProvider.ReflectionDomainOperationEntry.Invoke(DomainService domainService, Object[] parameters)
at System.ServiceModel.DomainServices.Server.DomainService.InvokeDomainOperationEntry(DomainOperationEntry domainOperationEntry, Object[] parameters, ChangeSetEntry operation)
at System.ServiceModel.DomainServices.Server.DomainService.InvokeCudOperations()
at System.ServiceModel.DomainServices.Server.DomainService.ExecuteChangeSet()
at System.ServiceModel.DomainServices.Server.DomainService.Submit(ChangeSet changeSet)
at Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.RiaDataProvider.SubmitCore(IEnumerable`1 changes)
at Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.DataProvider.Submit(IEnumerable`1 changes)
at Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation`1.PerformPersistCore(IEnumerable`1 eventsChangeSetItems)
at Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation`1.<>c__DisplayClass46.<PerformPersist>b__45()
at Microsoft.LightSwitch.Threading.DualDispatcherObject.Mutate(IDispatcher logicDispatcher, MutatorHost host, Action mutator)
at Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation`1.PerformPersist(IEnumerable`1 eventsChangeSetItems)
at Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation`1.Microsoft.LightSwitch.ServerGenerated.Implementation.IServerDataServiceImplementationCore.Submit()
at Microsoft.LightSwitch.ServerGenerated.Implementation.DataService`1.<>c__DisplayClass12.<Microsoft.LightSwitch.ServerGenerated.Implementation.IODataService.SaveChanges>b__10()
at Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation`1.InvokeOperationCore[T](String operationName, Object[] args, Boolean invokedFromODataClient, Func`1 invokeOperation, Action catchCallback, Action`2 serializeCustomExceptionInfo)
— End of inner exception stack trace —
[Microsoft.LightSwitch.UserCode][Application:Information][XtraReportsServiceData:SaveChanges:ExecuteFailed] Invoking user method: XtraReportsServiceDataService.SaveChanges_ExecuteFailed
[Microsoft.LightSwitch.UserCode][Application:Verbose][XtraReportsServiceData:SaveChanges:ExecuteFailed] A user implemented method does not exist.
[Microsoft.LightSwitch.UserCode][Application:Information][XtraReportsServiceData:SaveChanges:ExecuteFailed] Execution completed.
[Microsoft.LightSwitch.DataService][Application:Information][LightSwitchServiceApplication.XtraReportsServiceData:SaveChanges] Finished executing 'SaveChanges'
The thread '<No Name>' (0x1760) has exited with code 0 (0x0).
The thread '<No Name>' (0x15a8) has exited with code 0 (0x0).
The thread '<No Name>' (0x13c8) has exited with code 0 (0x0).
The thread '<No Name>' (0x1628) has exited with code 0 (0x0).
The thread '<No Name>' (0x1540) has exited with code 0 (0x0).
The thread '<No Name>' (0x10f4) has exited with code 0 (0x0).
The thread '<No Name>' (0x17c8) has exited with code 0 (0x0).
The thread '<No Name>' (0x16ec) has exited with code 0 (0x0).
Would you please make a detailed screencast, illustrating the issue (for example, using the Jing Tool), and send it to us? This will make the situation clearer.