locked
RIA Service Query gets called twice RRS feed

  • Question

  • Hi there,

    I have another problem in my project, which is, again, pretty weird. It's weird, because it only occurs in my project and not in any other project. But I don't have the slightest clue where to search for the issue.

    Let's say we add a new entry to a table. The <tablename>.Inserting gets called, and there, we change a field of the entity based on a field from the database. It's some kind of autoinc. Now, the request for the number which should be entered into the field is handed down to a RIA Service. The function is implemented in this way:

     public partial class DatenbankDomainService : LinqToEntitiesDomainService<DatenbankVerbindung>
        {
            [Query(IsDefault = true)]
            public IQueryable<z_FreieNr> Getz_FreieNr()
            {
                IQueryable<z_FreieNr> ergebnis = null;
                return ergebnis;
            }
    
            public IQueryable<z_FreieNr> Getz_FreieNrErgebnis(string tabelle, string schluesselfeld, string ansichtTabelle, double? maximaleNummer)
            {
    	//Do a lot of Stuff
    
                List<z_FreieNr> rueckgabewert = new List<z_FreieNr>();
    
                rueckgabewert.Add( new z_FreieNr { tabelle = "test", letzte_nummer = 125});
    
                return rueckgabewert.AsQueryable();
            }
    }


    It's really strange, but the Getz_FreieNrErgebnis gets called twice. It returns the IQueryable, and directly after, it goes back to the beginning of this function. So I looked at the callstacks.

    This is the first:

    >	WCF_RIA_Datenbank.dll!WCF_RIA_Datenbank.DatenbankDomainService.Getz_FreieNrErgebnis(string tabelle, string schluesselfeld, string ansichtTabelle, double? maximaleNummer) Zeile 43	C#
     	[Lightweightfunktion]	
     	System.ServiceModel.DomainServices.Server.dll!System.ServiceModel.DomainServices.Server.ReflectionDomainServiceDescriptionProvider.ReflectionDomainOperationEntry.Invoke(System.ServiceModel.DomainServices.Server.DomainService domainService, object[] parameters) + 0xf Bytes	
     	System.ServiceModel.DomainServices.Server.dll!System.ServiceModel.DomainServices.Server.DomainOperationEntry.Invoke(System.ServiceModel.DomainServices.Server.DomainService domainService, object[] parameters, out int totalCount) + 0xad Bytes	
     	System.ServiceModel.DomainServices.Server.dll!System.ServiceModel.DomainServices.Server.DomainService.Query(System.ServiceModel.DomainServices.Server.QueryDescription queryDescription, out System.Collections.Generic.IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> validationErrors, out int totalCount) + 0x1be Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.RiaDataProvider.CustomQuery<WCF_RIA_Datenbank.z_FreieNr>.Execute(System.Linq.Expressions.Expression expression) + 0x336 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.RiaDataProvider.CustomQuery<WCF_RIA_Datenbank.z_FreieNr>.System.Collections.IEnumerable.GetEnumerator() + 0x2e Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.RiaDataProvider.DomainServiceQuery<Datenverbindung.Implementation.z_FreieNrItem>.Execute<Datenverbindung.Implementation.z_FreieNrItem>(System.Linq.IQueryable innerQuery, System.Linq.Expressions.Expression outerExpression) + 0xad Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.OuterQuery<Datenverbindung.Implementation.z_FreieNrItem>.ExecuteInternal<Datenverbindung.Implementation.z_FreieNrItem>(System.Linq.IQueryable innerQuery, System.Linq.Expressions.Expression outerExpression) + 0x8b Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.OuterQueryExecutor<Datenverbindung.Implementation.z_FreieNrItem>.Execute<Datenverbindung.Implementation.z_FreieNrItem>(System.Linq.Expressions.Expression expression) + 0xa0 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.OuterQuery<Datenverbindung.Implementation.z_FreieNrItem>.GetEnumerator() + 0x76 Bytes	
     	System.Core.dll!System.Linq.Enumerable.WhereSelectEnumerableIterator<System.Data.Objects.DataClasses.EntityObject,Microsoft.LightSwitch.IEntityObject>.MoveNext() + 0x3e Bytes	
     	System.Core.dll!System.Linq.Enumerable.CastIterator<LightSwitchApplication.z_FreieNrItem>.MoveNext() + 0x56 Bytes	
     	mscorlib.dll!System.Collections.Generic.List<LightSwitchApplication.z_FreieNrItem>.List(System.Collections.Generic.IEnumerable<LightSwitchApplication.z_FreieNrItem> collection) + 0x17e Bytes	
     	System.Core.dll!System.Linq.Enumerable.ToList<LightSwitchApplication.z_FreieNrItem>(System.Collections.Generic.IEnumerable<LightSwitchApplication.z_FreieNrItem> source) + 0x3b Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.QueryImplementation<LightSwitchApplication.z_FreieNrItem>.DoExecution.AnonymousMethod__1() + 0x311 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.InvokeOperationCore<System.Collections.Generic.List<LightSwitchApplication.z_FreieNrItem>>(string operationName, object[] args, bool invokedFromODataClient, System.Func<System.Collections.Generic.List<LightSwitchApplication.z_FreieNrItem>> invokeOperation, System.Action catchCallback, System.Action<System.Exception,System.Xml.XmlWriter> serializeCustomExceptionInfo) + 0x227 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.Microsoft.LightSwitch.ServerGenerated.Implementation.IServerDataServiceImplementationCore.InvokeOperation<System.Collections.Generic.List<LightSwitchApplication.z_FreieNrItem>>(string operationName, object[] args, bool invokedFromODataClient, System.Func<System.Collections.Generic.List<LightSwitchApplication.z_FreieNrItem>> invokeOperation, System.Action catchCallback, System.Action<System.Exception,System.Xml.XmlWriter> serializeCustomExceptionInfo) + 0x66 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.QueryImplementation<LightSwitchApplication.z_FreieNrItem>.DoExecution.AnonymousMethod__0() + 0x16d Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Threading.DualDispatcherObject.Mutate(Microsoft.LightSwitch.Threading.IDispatcher logicDispatcher, Microsoft.LightSwitch.Threading.DualDispatcherObject.MutatorHost host, System.Action mutator) + 0x330 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Threading.DualDispatcherObject.Mutate(Microsoft.LightSwitch.Threading.DualDispatcherObject.MutatorHost host, System.Action mutator) + 0x44 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.QueryImplementation<LightSwitchApplication.z_FreieNrItem>.DoExecution(Microsoft.LightSwitch.Framework.Base.ExecutableObject<System.Collections.Generic.IEnumerable<LightSwitchApplication.z_FreieNrItem>>.ExecutionWithResult execution) + 0x124 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Framework.Base.ExecutableObject<System.Collections.Generic.IEnumerable<LightSwitchApplication.z_FreieNrItem>>.DoExecution(Microsoft.LightSwitch.Framework.Base.ExecutableObject.Execution execution) + 0xb3 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Framework.Base.ExecutableObject.DoExecutionCore(Microsoft.LightSwitch.Framework.Base.ExecutableObject.Execution execution) + 0xbe Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Framework.Base.ExecutableObject.Execute(bool allowJoin) + 0x25c Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Framework.Base.ExecutableObject.Execute() + 0x20 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Framework.Base.ExecutableObject<System.Collections.Generic.IEnumerable<LightSwitchApplication.z_FreieNrItem>>.Execute() + 0x2d Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.QueryImplementation<LightSwitchApplication.z_FreieNrItem>.Microsoft.LightSwitch.IDataServiceQueryable<T>.Execute() + 0x24 Bytes	
     	Application.Server.dll!LightSwitchApplication.LibServer.FreieNr(string tabelle, string schluesselfeld, string ansicht, double? maximalerWert) Zeile 73 + 0x47 Bytes	C#
     	Application.Server.dll!LightSwitchApplication.LibServer.FreieNr(string tabelle, string schluesselfeld) Zeile 96 + 0x37 Bytes	C#
     	Application.Server.dll!LightSwitchApplication.DatenverbindungService.sprache_Inserting(LightSwitchApplication.spracheItem entity) Zeile 395 + 0x18 Bytes	C#
     	Application.Server.dll!LightSwitchApplication.DatenverbindungService.DetailsClass.__sprache_Inserting(LightSwitchApplication.DatenverbindungService d, LightSwitchApplication.spracheItem e) Zeile 7831 + 0xe Bytes	C#
     	Microsoft.LightSwitch.Server.dll!Microsoft.LightSwitch.Details.Framework.Server.EntitySetEntry<LightSwitchApplication.DatenverbindungService,LightSwitchApplication.spracheItem>.Microsoft.LightSwitch.Details.Framework.Server.IEntitySetEntry.InvokeInserting(Microsoft.LightSwitch.IDataService dataService, Microsoft.LightSwitch.IEntityObject entity) + 0xac Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.PerformPreEvent.AnonymousMethod__3a(Microsoft.LightSwitch.Details.Framework.Server.IEntitySetEntry entitySetEntry) + 0x3d Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.CallPrePostUserCode.AnonymousMethod__42() + 0x29 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Utilities.Internal.UserCodeHelper.CallUserCode(System.Type sourceType, string methodName, string instance, string operation, Microsoft.LightSwitch.BaseServices.Logging.Internal.ILoggingContext context, System.Action action, string additionalText, System.Func<string> getCompletedMessage, bool tryHandleException, bool swallowException, out System.Exception exception) + 0x303 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Utilities.Internal.UserCodeHelper.CallUserCode(System.Type sourceType, string methodName, string instance, string operation, string additionalText, Microsoft.LightSwitch.BaseServices.Logging.Internal.ILoggingContext context, System.Action action) + 0x46 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.CallPrePostUserCode(string eventName, Microsoft.LightSwitch.IEntityObject entity, System.Action<Microsoft.LightSwitch.Details.Framework.Server.IEntitySetEntry> invokeUserCode) + 0x30d Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.PerformPreEvent(System.Collections.Generic.IEnumerable<Microsoft.LightSwitch.ServerGenerated.Implementation.DynamicChangeSetItem> changeSetItems) + 0x29d Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.Microsoft.LightSwitch.ServerGenerated.Implementation.IServerDataServiceImplementationCore.Submit() + 0x148 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataService<Datenverbindung.Implementation.DatenverbindungObjectContext>.Microsoft.LightSwitch.ServerGenerated.Implementation.IODataService.SaveChanges.AnonymousMethod__10() + 0x6f Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.InvokeOperationCore<object>(string operationName, object[] args, bool invokedFromODataClient, System.Func<object> invokeOperation, System.Action catchCallback, System.Action<System.Exception,System.Xml.XmlWriter> serializeCustomExceptionInfo) + 0x227 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.Microsoft.LightSwitch.ServerGenerated.Implementation.IServerDataServiceImplementationCore.InvokeOperation<object>(string operationName, object[] args, bool invokedFromODataClient, System.Func<object> invokeOperation, System.Action catchCallback, System.Action<System.Exception,System.Xml.XmlWriter> serializeCustomExceptionInfo) + 0x66 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataService<Datenverbindung.Implementation.DatenverbindungObjectContext>.Microsoft.LightSwitch.ServerGenerated.Implementation.IODataService.SaveChanges(System.Action preprocessChanges) + 0x1cc Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceUpdateProvider.SaveChanges.AnonymousMethod__a() + 0x135 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Threading.DispatcherExtensions.Invoke.AnonymousMethod__0() + 0x57 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Threading.DispatcherBase.Invoke(System.Action action) + 0xb4 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.Threading.ServerGenerated.Internal.ServiceRequestDispatcher.BeginInvokeCore(System.Action action) + 0x25 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Threading.DispatcherBase.BeginInvoke(System.Action action) + 0x8d Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Threading.DispatcherExtensions.BeginInvoke(Microsoft.LightSwitch.Threading.IDispatcher dispatcher, Microsoft.LightSwitch.Threading.DispatcherActionPriority priority, System.Action action) + 0xa9 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Threading.DispatcherExtensions.Invoke(Microsoft.LightSwitch.Threading.IDispatcher dispatcher, System.Action action) + 0x23c Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataService<Datenverbindung.Implementation.DatenverbindungObjectContext>.LogicInvoke(System.Action a) + 0x35 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataService<Datenverbindung.Implementation.DatenverbindungObjectContext>.Microsoft.LightSwitch.ServerGenerated.Implementation.IODataService.LogicInvoke(System.Action a) + 0x26 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceUpdateProvider.LogicInvoke(System.Action a) + 0x29 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceUpdateProvider.SaveChanges() + 0x10d Bytes	
     	Microsoft.Data.Services.dll!System.Data.Services.DataService<Datenverbindung.Implementation.DatenverbindungObjectContext>.BatchDataService.HandleBatchContent(System.IO.Stream responseStream) + 0x380 Bytes	
     	Microsoft.Data.Services.dll!System.Data.Services.DelegateBodyWriter.OnWriteBodyContents(System.Xml.XmlDictionaryWriter writer) + 0x73 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.BodyWriterMessage.OnWriteBodyContents(System.Xml.XmlDictionaryWriter writer) + 0x21 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.Message.OnWriteMessage(System.Xml.XmlDictionaryWriter writer) + 0x1e Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.Message.WriteMessage(System.Xml.XmlWriter writer) + 0x25 Bytes	
     	System.ServiceModel.Channels.dll!System.ServiceModel.Channels.ByteStreamMessageEncoder.WriteMessage(System.ServiceModel.Channels.Message message, int maxMessageSize, System.ServiceModel.Channels.BufferManager bufferManager, int messageOffset) + 0x110 Bytes	
     	System.ServiceModel.Web.dll!System.ServiceModel.Channels.WebMessageEncoderFactory.WebMessageEncoder.WriteMessage(System.ServiceModel.Channels.Message message, int maxMessageSize, System.ServiceModel.Channels.BufferManager bufferManager, int messageOffset) + 0x174 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(System.ServiceModel.Channels.Message message) + 0x5a Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpOutput.Send(System.TimeSpan timeout) + 0x61 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpPipeline.EmptyHttpPipeline.SendReplyCore(System.ServiceModel.Channels.Message message, System.TimeSpan timeout) + 0x39 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpPipeline.EmptyHttpPipeline.SendReply(System.ServiceModel.Channels.Message message, System.TimeSpan timeout) + 0x24 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpRequestContext.OnReply(System.ServiceModel.Channels.Message message, System.TimeSpan timeout) + 0x68 Bytes	
     	System.ServiceModel.Activation.dll!System.ServiceModel.Activation.HostedHttpContext.OnReply(System.ServiceModel.Channels.Message message, System.TimeSpan timeout) + 0x30 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.RequestContextBase.Reply(System.ServiceModel.Channels.Message message, System.TimeSpan timeout) + 0x8f Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Reply(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x59 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage9(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x72 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage8(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0xf3 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage6(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0xb5 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x1d8 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x5b Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x9f Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x59 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x3b Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x4e Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x118 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x34 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.MessageRpc.Process(bool isOperationContextSet) + 0xf7 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(System.ServiceModel.Channels.RequestContext request, bool cleanThread, System.ServiceModel.OperationContext currentOperationContext) + 0x574 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(System.ServiceModel.Channels.RequestContext request, System.ServiceModel.OperationContext currentOperationContext) + 0x122 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(System.IAsyncResult result) + 0x3f Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(System.IAsyncResult result) + 0x3f Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(System.IAsyncResult result) + 0x2c Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.AsyncResult.Complete(bool completedSynchronously) + 0x11f Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.AsyncQueueReader.Set(System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.Item item) + 0x44 Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.EnqueueAndDispatch(System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.Item item, bool canDispatchOnThisThread) + 0x1b0 Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.EnqueueAndDispatch(System.ServiceModel.Channels.RequestContext item, System.Action dequeuedCallback, bool canDispatchOnThisThread) + 0x60 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.SingletonChannelAcceptor<System.ServiceModel.Channels.IReplyChannel,System.ServiceModel.Channels.ReplyChannel,System.ServiceModel.Channels.RequestContext>.Enqueue(System.ServiceModel.Channels.RequestContext item, System.Action dequeuedCallback, bool canDispatchOnThisThread) + 0x6b Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.CompleteParseAndEnqueue(System.IAsyncResult result) + 0x78 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.HandleParseIncomingMessage(System.IAsyncResult result) + 0x33 Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(System.IAsyncResult result) + 0x8a Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(System.IAsyncResult result) + 0x2c Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.AsyncResult.Complete(bool completedSynchronously) + 0x11f Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.AsyncResult.Complete(bool completedSynchronously, System.Exception exception) + 0x1c Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpInput.ParseMessageAsyncResult.OnRead(System.IAsyncResult result) + 0x98 Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(System.IAsyncResult result) + 0x2c Bytes	
     	mscorlib.dll!System.IO.Stream.ReadWriteTask.InvokeAsyncCallback(object completedTask) + 0x2c Bytes	
     	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0xa7 Bytes	
     	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x16 Bytes	
     	mscorlib.dll!System.IO.Stream.ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke(System.Threading.Tasks.Task completingTask) + 0xab Bytes	
     	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() + 0x221 Bytes	
     	mscorlib.dll!System.Threading.Tasks.Task.FinishStageThree() + 0x1c Bytes	
     	mscorlib.dll!System.Threading.Tasks.Task.FinishStageTwo() + 0x84 Bytes	
     	mscorlib.dll!System.Threading.Tasks.Task.Finish(bool bUserDelegateExecuted) + 0x30 Bytes	
     	mscorlib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot) + 0xd6 Bytes	
     	mscorlib.dll!System.Threading.Tasks.Task.ExecuteEntry(bool bPreventDoubleExecution) + 0xb3 Bytes	
     	mscorlib.dll!System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() + 0x7 Bytes	
     	mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() + 0x149 Bytes	
     	mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() + 0x5 Bytes	
     	[Übergang von Systemeigen zu Verwaltet]	
     	[Anwendungsdomänenübergang]	
     	[Übergang von Systemeigen zu Verwaltet]	
    

    And at the second call:

    >	WCF_RIA_Datenbank.dll!WCF_RIA_Datenbank.DatenbankDomainService.Getz_FreieNrErgebnis(string tabelle, string schluesselfeld, string ansichtTabelle, double? maximaleNummer) Zeile 43	C#
     	[Lightweightfunktion]	
     	System.ServiceModel.DomainServices.Server.dll!System.ServiceModel.DomainServices.Server.ReflectionDomainServiceDescriptionProvider.ReflectionDomainOperationEntry.Invoke(System.ServiceModel.DomainServices.Server.DomainService domainService, object[] parameters) + 0xf Bytes	
     	System.ServiceModel.DomainServices.Server.dll!System.ServiceModel.DomainServices.Server.DomainOperationEntry.Invoke(System.ServiceModel.DomainServices.Server.DomainService domainService, object[] parameters, out int totalCount) + 0xad Bytes	
     	System.ServiceModel.DomainServices.Server.dll!System.ServiceModel.DomainServices.Server.DomainService.Query(System.ServiceModel.DomainServices.Server.QueryDescription queryDescription, out System.Collections.Generic.IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> validationErrors, out int totalCount) + 0x1be Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.RiaDataProvider.CustomQuery<WCF_RIA_Datenbank.z_FreieNr>.Execute(System.Linq.Expressions.Expression expression) + 0x336 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.RiaDataProvider.CustomQuery<WCF_RIA_Datenbank.z_FreieNr>.System.Collections.IEnumerable.GetEnumerator() + 0x2e Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.RiaDataProvider.DomainServiceQuery<Datenverbindung.Implementation.z_FreieNrItem>.Execute<Datenverbindung.Implementation.z_FreieNrItem>(System.Linq.IQueryable innerQuery, System.Linq.Expressions.Expression outerExpression) + 0xad Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.OuterQuery<Datenverbindung.Implementation.z_FreieNrItem>.ExecuteInternal<Datenverbindung.Implementation.z_FreieNrItem>(System.Linq.IQueryable innerQuery, System.Linq.Expressions.Expression outerExpression) + 0x8b Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.OuterQueryExecutor<Datenverbindung.Implementation.z_FreieNrItem>.Execute<Datenverbindung.Implementation.z_FreieNrItem>(System.Linq.Expressions.Expression expression) + 0xa0 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.OuterQuery<Datenverbindung.Implementation.z_FreieNrItem>.GetEnumerator() + 0x76 Bytes	
     	System.Core.dll!System.Linq.Enumerable.WhereSelectEnumerableIterator<System.Data.Objects.DataClasses.EntityObject,Microsoft.LightSwitch.IEntityObject>.MoveNext() + 0x3e Bytes	
     	System.Core.dll!System.Linq.Enumerable.CastIterator<LightSwitchApplication.z_FreieNrItem>.MoveNext() + 0x56 Bytes	
     	mscorlib.dll!System.Collections.Generic.List<LightSwitchApplication.z_FreieNrItem>.List(System.Collections.Generic.IEnumerable<LightSwitchApplication.z_FreieNrItem> collection) + 0x17e Bytes	
     	System.Core.dll!System.Linq.Enumerable.ToList<LightSwitchApplication.z_FreieNrItem>(System.Collections.Generic.IEnumerable<LightSwitchApplication.z_FreieNrItem> source) + 0x3b Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.QueryImplementation<LightSwitchApplication.z_FreieNrItem>.DoExecution.AnonymousMethod__1() + 0x311 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.InvokeOperationCore<System.Collections.Generic.List<LightSwitchApplication.z_FreieNrItem>>(string operationName, object[] args, bool invokedFromODataClient, System.Func<System.Collections.Generic.List<LightSwitchApplication.z_FreieNrItem>> invokeOperation, System.Action catchCallback, System.Action<System.Exception,System.Xml.XmlWriter> serializeCustomExceptionInfo) + 0x227 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.Microsoft.LightSwitch.ServerGenerated.Implementation.IServerDataServiceImplementationCore.InvokeOperation<System.Collections.Generic.List<LightSwitchApplication.z_FreieNrItem>>(string operationName, object[] args, bool invokedFromODataClient, System.Func<System.Collections.Generic.List<LightSwitchApplication.z_FreieNrItem>> invokeOperation, System.Action catchCallback, System.Action<System.Exception,System.Xml.XmlWriter> serializeCustomExceptionInfo) + 0x66 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.QueryImplementation<LightSwitchApplication.z_FreieNrItem>.DoExecution.AnonymousMethod__0() + 0x16d Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Threading.DualDispatcherObject.Mutate(Microsoft.LightSwitch.Threading.IDispatcher logicDispatcher, Microsoft.LightSwitch.Threading.DualDispatcherObject.MutatorHost host, System.Action mutator) + 0x330 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Threading.DualDispatcherObject.Mutate(Microsoft.LightSwitch.Threading.DualDispatcherObject.MutatorHost host, System.Action mutator) + 0x44 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.QueryImplementation<LightSwitchApplication.z_FreieNrItem>.DoExecution(Microsoft.LightSwitch.Framework.Base.ExecutableObject<System.Collections.Generic.IEnumerable<LightSwitchApplication.z_FreieNrItem>>.ExecutionWithResult execution) + 0x124 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Framework.Base.ExecutableObject<System.Collections.Generic.IEnumerable<LightSwitchApplication.z_FreieNrItem>>.DoExecution(Microsoft.LightSwitch.Framework.Base.ExecutableObject.Execution execution) + 0xb3 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Framework.Base.ExecutableObject.DoExecutionCore(Microsoft.LightSwitch.Framework.Base.ExecutableObject.Execution execution) + 0xbe Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Framework.Base.ExecutableObject.Execute(bool allowJoin) + 0x25c Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Framework.Base.ExecutableObject.Execute() + 0x20 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Framework.Base.ExecutableObject<System.Collections.Generic.IEnumerable<LightSwitchApplication.z_FreieNrItem>>.Execute() + 0x2d Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.QueryImplementation<LightSwitchApplication.z_FreieNrItem>.Microsoft.LightSwitch.IDataServiceQueryable<T>.Execute() + 0x24 Bytes	
     	Application.Server.dll!LightSwitchApplication.LibServer.FreieNr(string tabelle, string schluesselfeld, string ansicht, double? maximalerWert) Zeile 73 + 0x47 Bytes	C#
     	Application.Server.dll!LightSwitchApplication.LibServer.FreieNr(string tabelle, string schluesselfeld) Zeile 96 + 0x37 Bytes	C#
     	Application.Server.dll!LightSwitchApplication.DatenverbindungService.sprache_Inserting(LightSwitchApplication.spracheItem entity) Zeile 395 + 0x18 Bytes	C#
     	Application.Server.dll!LightSwitchApplication.DatenverbindungService.DetailsClass.__sprache_Inserting(LightSwitchApplication.DatenverbindungService d, LightSwitchApplication.spracheItem e) Zeile 7831 + 0xe Bytes	C#
     	Microsoft.LightSwitch.Server.dll!Microsoft.LightSwitch.Details.Framework.Server.EntitySetEntry<LightSwitchApplication.DatenverbindungService,LightSwitchApplication.spracheItem>.Microsoft.LightSwitch.Details.Framework.Server.IEntitySetEntry.InvokeInserting(Microsoft.LightSwitch.IDataService dataService, Microsoft.LightSwitch.IEntityObject entity) + 0xac Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.PerformPreEvent.AnonymousMethod__3a(Microsoft.LightSwitch.Details.Framework.Server.IEntitySetEntry entitySetEntry) + 0x3d Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.CallPrePostUserCode.AnonymousMethod__42() + 0x29 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Utilities.Internal.UserCodeHelper.CallUserCode(System.Type sourceType, string methodName, string instance, string operation, Microsoft.LightSwitch.BaseServices.Logging.Internal.ILoggingContext context, System.Action action, string additionalText, System.Func<string> getCompletedMessage, bool tryHandleException, bool swallowException, out System.Exception exception) + 0x303 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Utilities.Internal.UserCodeHelper.CallUserCode(System.Type sourceType, string methodName, string instance, string operation, string additionalText, Microsoft.LightSwitch.BaseServices.Logging.Internal.ILoggingContext context, System.Action action) + 0x46 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.CallPrePostUserCode(string eventName, Microsoft.LightSwitch.IEntityObject entity, System.Action<Microsoft.LightSwitch.Details.Framework.Server.IEntitySetEntry> invokeUserCode) + 0x30d Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.PerformPreEvent(System.Collections.Generic.IEnumerable<Microsoft.LightSwitch.ServerGenerated.Implementation.DynamicChangeSetItem> changeSetItems) + 0x29d Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.Microsoft.LightSwitch.ServerGenerated.Implementation.IServerDataServiceImplementationCore.Submit() + 0x148 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataService<Datenverbindung.Implementation.DatenverbindungObjectContext>.Microsoft.LightSwitch.ServerGenerated.Implementation.IODataService.SaveChanges.AnonymousMethod__10() + 0x6f Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.InvokeOperationCore<object>(string operationName, object[] args, bool invokedFromODataClient, System.Func<object> invokeOperation, System.Action catchCallback, System.Action<System.Exception,System.Xml.XmlWriter> serializeCustomExceptionInfo) + 0x227 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.Microsoft.LightSwitch.ServerGenerated.Implementation.IServerDataServiceImplementationCore.InvokeOperation<object>(string operationName, object[] args, bool invokedFromODataClient, System.Func<object> invokeOperation, System.Action catchCallback, System.Action<System.Exception,System.Xml.XmlWriter> serializeCustomExceptionInfo) + 0x66 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataService<Datenverbindung.Implementation.DatenverbindungObjectContext>.Microsoft.LightSwitch.ServerGenerated.Implementation.IODataService.SaveChanges(System.Action preprocessChanges) + 0x1cc Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceUpdateProvider.SaveChanges.AnonymousMethod__a() + 0x135 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Threading.DispatcherExtensions.Invoke.AnonymousMethod__0() + 0x57 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Threading.DispatcherBase.Invoke(System.Action action) + 0xb4 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.Threading.ServerGenerated.Internal.ServiceRequestDispatcher.BeginInvokeCore(System.Action action) + 0x25 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Threading.DispatcherBase.BeginInvoke(System.Action action) + 0x8d Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Threading.DispatcherExtensions.BeginInvoke(Microsoft.LightSwitch.Threading.IDispatcher dispatcher, Microsoft.LightSwitch.Threading.DispatcherActionPriority priority, System.Action action) + 0xa9 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.Threading.DispatcherExtensions.Invoke(Microsoft.LightSwitch.Threading.IDispatcher dispatcher, System.Action action) + 0x23c Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataService<Datenverbindung.Implementation.DatenverbindungObjectContext>.LogicInvoke(System.Action a) + 0x35 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataService<Datenverbindung.Implementation.DatenverbindungObjectContext>.Microsoft.LightSwitch.ServerGenerated.Implementation.IODataService.LogicInvoke(System.Action a) + 0x26 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceUpdateProvider.LogicInvoke(System.Action a) + 0x29 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceUpdateProvider.SaveChanges() + 0x10d Bytes	
     	Microsoft.Data.Services.dll!System.Data.Services.DataService<Datenverbindung.Implementation.DatenverbindungObjectContext>.BatchDataService.HandleBatchContent(System.IO.Stream responseStream) + 0x380 Bytes	
     	Microsoft.Data.Services.dll!System.Data.Services.DelegateBodyWriter.OnWriteBodyContents(System.Xml.XmlDictionaryWriter writer) + 0x73 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.BodyWriterMessage.OnWriteBodyContents(System.Xml.XmlDictionaryWriter writer) + 0x21 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.Message.OnWriteMessage(System.Xml.XmlDictionaryWriter writer) + 0x1e Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.Message.WriteMessage(System.Xml.XmlWriter writer) + 0x25 Bytes	
     	System.ServiceModel.Channels.dll!System.ServiceModel.Channels.ByteStreamMessageEncoder.WriteMessage(System.ServiceModel.Channels.Message message, int maxMessageSize, System.ServiceModel.Channels.BufferManager bufferManager, int messageOffset) + 0x110 Bytes	
     	System.ServiceModel.Web.dll!System.ServiceModel.Channels.WebMessageEncoderFactory.WebMessageEncoder.WriteMessage(System.ServiceModel.Channels.Message message, int maxMessageSize, System.ServiceModel.Channels.BufferManager bufferManager, int messageOffset) + 0x174 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(System.ServiceModel.Channels.Message message) + 0x5a Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpOutput.Send(System.TimeSpan timeout) + 0x61 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpPipeline.EmptyHttpPipeline.SendReplyCore(System.ServiceModel.Channels.Message message, System.TimeSpan timeout) + 0x39 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpPipeline.EmptyHttpPipeline.SendReply(System.ServiceModel.Channels.Message message, System.TimeSpan timeout) + 0x24 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpRequestContext.OnReply(System.ServiceModel.Channels.Message message, System.TimeSpan timeout) + 0x68 Bytes	
     	System.ServiceModel.Activation.dll!System.ServiceModel.Activation.HostedHttpContext.OnReply(System.ServiceModel.Channels.Message message, System.TimeSpan timeout) + 0x30 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.RequestContextBase.Reply(System.ServiceModel.Channels.Message message, System.TimeSpan timeout) + 0x8f Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Reply(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x59 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage9(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x72 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage8(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0xf3 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage6(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0xb5 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x1d8 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x5b Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x9f Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x59 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x3b Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x4e Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x118 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(ref System.ServiceModel.Dispatcher.MessageRpc rpc) + 0x34 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.MessageRpc.Process(bool isOperationContextSet) + 0xf7 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(System.ServiceModel.Channels.RequestContext request, bool cleanThread, System.ServiceModel.OperationContext currentOperationContext) + 0x574 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(System.ServiceModel.Channels.RequestContext request, System.ServiceModel.OperationContext currentOperationContext) + 0x122 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(System.IAsyncResult result) + 0x3f Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(System.IAsyncResult result) + 0x3f Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(System.IAsyncResult result) + 0x2c Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.AsyncResult.Complete(bool completedSynchronously) + 0x11f Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.AsyncQueueReader.Set(System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.Item item) + 0x44 Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.EnqueueAndDispatch(System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.Item item, bool canDispatchOnThisThread) + 0x1b0 Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.InputQueue<System.ServiceModel.Channels.RequestContext>.EnqueueAndDispatch(System.ServiceModel.Channels.RequestContext item, System.Action dequeuedCallback, bool canDispatchOnThisThread) + 0x60 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.SingletonChannelAcceptor<System.ServiceModel.Channels.IReplyChannel,System.ServiceModel.Channels.ReplyChannel,System.ServiceModel.Channels.RequestContext>.Enqueue(System.ServiceModel.Channels.RequestContext item, System.Action dequeuedCallback, bool canDispatchOnThisThread) + 0x6b Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.CompleteParseAndEnqueue(System.IAsyncResult result) + 0x78 Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.HandleParseIncomingMessage(System.IAsyncResult result) + 0x33 Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(System.IAsyncResult result) + 0x8a Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(System.IAsyncResult result) + 0x2c Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.AsyncResult.Complete(bool completedSynchronously) + 0x11f Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.AsyncResult.Complete(bool completedSynchronously, System.Exception exception) + 0x1c Bytes	
     	System.ServiceModel.dll!System.ServiceModel.Channels.HttpInput.ParseMessageAsyncResult.OnRead(System.IAsyncResult result) + 0x98 Bytes	
     	System.ServiceModel.Internals.dll!System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(System.IAsyncResult result) + 0x2c Bytes	
     	mscorlib.dll!System.IO.Stream.ReadWriteTask.InvokeAsyncCallback(object completedTask) + 0x2c Bytes	
     	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0xa7 Bytes	
     	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x16 Bytes	
     	mscorlib.dll!System.IO.Stream.ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke(System.Threading.Tasks.Task completingTask) + 0xab Bytes	
     	mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations() + 0x221 Bytes	
     	mscorlib.dll!System.Threading.Tasks.Task.FinishStageThree() + 0x1c Bytes	
     	mscorlib.dll!System.Threading.Tasks.Task.FinishStageTwo() + 0x84 Bytes	
     	mscorlib.dll!System.Threading.Tasks.Task.Finish(bool bUserDelegateExecuted) + 0x30 Bytes	
     	mscorlib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot) + 0xd6 Bytes	
     	mscorlib.dll!System.Threading.Tasks.Task.ExecuteEntry(bool bPreventDoubleExecution) + 0xb3 Bytes	
     	mscorlib.dll!System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() + 0x7 Bytes	
     	mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() + 0x149 Bytes	
     	mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() + 0x5 Bytes	
     	[Übergang von Systemeigen zu Verwaltet]	
     	[Anwendungsdomänenübergang]	
     	[Übergang von Systemeigen zu Verwaltet]	
    

    Now, comparing them both with WinMerge, there is a small block that is different:

    First call:

     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.OuterQuery<Datenverbindung.Implementation.z_FreieNrItem>.System.Collections.IEnumerable.GetEnumerator() + 0x24 Bytes	
     	System.Core.dll!System.Linq.Enumerable.OfTypeIterator<object>.MoveNext() + 0x3f Bytes	
     	System.Core.dll!System.Linq.Enumerable.Count<object>(System.Collections.Generic.IEnumerable<object> source) + 0x102 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Platform.Internal.DataServiceLoggingHelper.LogQueryExecuted.AnonymousMethod__14() + 0x7a Bytes	
     	Microsoft.LightSwitch.Server.Internal.dll!Microsoft.LightSwitch.BaseServices.Logging.Implementation.LoggingService.LogToCategory(Microsoft.LightSwitch.BaseServices.Logging.Internal.Category category, Microsoft.LightSwitch.BaseServices.Logging.Internal.LogEventType type, Microsoft.LightSwitch.BaseServices.Logging.Internal.ILoggingContext context, string messageId, string instanceId, string eventId, System.Func<string> messageProvider) + 0x92 Bytes	
     	Microsoft.LightSwitch.dll!Microsoft.LightSwitch.BaseServices.Logging.Internal.Category.Log(Microsoft.LightSwitch.BaseServices.Logging.Internal.LogEventType type, Microsoft.LightSwitch.BaseServices.Logging.Internal.ILoggingContext context, string messageId, string instanceId, string eventId, System.Func<string> messageProvider) + 0x49 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Platform.Internal.DataServiceLoggingHelper.LogQueryExecuted(string queryName, System.Collections.IEnumerable results) + 0x122 Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.Microsoft.LightSwitch.ServerGenerated.Implementation.IServerDataServiceImplementationCore.ConvertEFQueryResultsToLS(System.Collections.IEnumerable efResults, System.Type lsResultsElementType, string queryName, System.Collections.Generic.IEnumerable<string> includes) + 0x5c Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.QueryImplementation<LightSwitchApplication.z_FreieNrItem>.DoExecution.AnonymousMethod__1() + 0x293 Bytes	

    Second call:

     	System.Core.dll!System.Linq.Enumerable.WhereSelectEnumerableIterator<System.Data.Objects.DataClasses.EntityObject,Microsoft.LightSwitch.IEntityObject>.MoveNext() + 0x3e Bytes	
     	System.Core.dll!System.Linq.Enumerable.CastIterator<LightSwitchApplication.z_FreieNrItem>.MoveNext() + 0x56 Bytes	
     	mscorlib.dll!System.Collections.Generic.List<LightSwitchApplication.z_FreieNrItem>.List(System.Collections.Generic.IEnumerable<LightSwitchApplication.z_FreieNrItem> collection) + 0x17e Bytes	
     	System.Core.dll!System.Linq.Enumerable.ToList<LightSwitchApplication.z_FreieNrItem>(System.Collections.Generic.IEnumerable<LightSwitchApplication.z_FreieNrItem> source) + 0x3b Bytes	
     	Microsoft.LightSwitch.Base.Server.dll!Microsoft.LightSwitch.ServerGenerated.Implementation.QueryImplementation<LightSwitchApplication.z_FreieNrItem>.DoExecution.AnonymousMethod__1() + 0x311 Bytes	
    
    
    

    Honestly, I'm at a dead end know and I'm pretty much desperate...

    Wednesday, January 30, 2013 1:44 PM

Answers

  • Aaaand me again. After three days of bug-hunting and nearly institutionalizing myself, I removed all tables and screens from the project and re-added them. Didn't work. So I saved the Client.lsml, the Common.lsml and the Service.lsml and created a new project. I re-added all the references and copied back the saved lsml's. It works.

    And I don't know why...



    • Edited by DanielGilbert Thursday, January 31, 2013 9:40 AM
    • Marked as answer by Angie Xu Wednesday, February 6, 2013 7:34 AM
    Thursday, January 31, 2013 9:39 AM

All replies

  • Apart from the CallStacks I've posted, here are two outputs. One from a working project, and one from the non-working project:

    The non-working project:

    Einzelschritt: System.Linq.Queryable.AsQueryable<WCF_RIA_Datenbank.z_FreieNr>-Methode
    Einzelschritt: System.ServiceModel.DomainServices.Server.DomainService.Query-Methode
    Einzelschritt: Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.RiaDataProvider.CustomQuery<WCF_RIA_Datenbank.z_FreieNr>.Execute-Methode
    Einzelschritt: Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.RiaDataProvider.CustomQuery<System.__Canon>.System.Collections.IEnumerable.GetEnumerator-Methode
    Einzelschritt: Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.RiaDataProvider.DomainServiceQuery<Datenverbindung.Implementation.z_FreieNrItem>.Execute<Datenverbindung.Implementation.z_FreieNrItem>-MethodeEinzelschritt: Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.OuterQuery<Datenverbindung.Implementation.z_FreieNrItem>.GetEnumerator-Methode
    Einzelschritt: System.Linq.Enumerable.OfTypeIterator<object>.MoveNext-Methode
    Einzelschritt: System.Linq.Enumerable.Count<object>-Methode
    Einzelschritt: Microsoft.LightSwitch.ServerGenerated.Platform.Internal.DataServiceLoggingHelper.LogQueryExecuted.AnonymousMethod__14-Methode
    [Microsoft.LightSwitch.DataService][Application:Information][LightSwitchServiceApplication.Datenverbindung:Getz_FreieNrErgebnis:QueryExecuted] The query returned 1 results.
    Einzelschritt: Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.Microsoft.LightSwitch.ServerGenerated.Implementation.IServerDataServiceImplementationCore.ConvertEFQ"SLLauncher.exe" (Silverlight): "c:\Program Files (x86)\Microsoft Silverlight\5.1.10411.0\de\mscorlib.debug.resources.dll" geladen

    And the working project:

    Einzelschritt: System.Linq.Queryable.AsQueryable<WCF_RIA_Datenbank.z_FreieNr>-Methode
    Einzelschritt: System.ServiceModel.DomainServices.Server.DomainService.Query-Methode
    Einzelschritt: Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.RiaDataProvider.CustomQuery<WCF_RIA_Datenbank.z_FreieNr>.Execute-Methode
    Einzelschritt: Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.RiaDataProvider.CustomQuery<System.__Canon>.System.Collections.IEnumerable.GetEnumerator-Methode
    Einzelschritt: Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.RiaDataProvider.DomainServiceQuery<Datenverbindung.Implementation.z_FreieNrItem>.Execute<Datenverbindung.Implementation.z_FreieNrItem>-MethodeEinzelschritt: Microsoft.LightSwitch.ServerGenerated.Implementation.DataProvider.OuterQuery<Datenverbindung.Implementation.z_FreieNrItem>.GetEnumerator-Methode
    Einzelschritt: System.Linq.Enumerable.WhereSelectEnumerableIterator<System.Data.Objects.DataClasses.EntityObject,Microsoft.LightSwitch.IEntityObject>.MoveNext-Methode
    Einzelschritt: System.Linq.Enumerable.CastIterator<LightSwitchApplication.z_FreieNrItem>.MoveNext-Methode
    Einzelschritt: System.Collections.Generic.List<LightSwitchApplication.z_FreieNrItem>.List-Methode
    Einzelschritt: System.Linq.Enumerable.ToList<LightSwitchApplication.z_FreieNrItem>-Methode
    Einzelschritt: Microsoft.LightSwitch.ServerGenerated.Implementation.QueryImplementation<LightSwitchApplication.z_FreieNrItem>.DoExecution.AnonymousMethod__1-Methode
    Einzelschritt: Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation<Datenverbindung.Implementation.DatenverbindungObjectContext>.InvokeOperationCore<System.Collections.Generic.List<LightSwitchApplication.z_FreieNrItem>>-Methode oEinzelschritt: Microsoft.LightSwitch.ServerGenerated.Implementation.QueryImplementation<LightSwitchApplication.z_FreieNrItem>.DoExecution.AnonymousMethod__0-Methode
    Einzelschritt: Microsoft.LightSwitch.Threading.DualDispatcherObject.Mutate-Methode
    Einzelschritt: Microsoft.LightSwitch.ServerGenerated.Implementation.QueryImplementation<LightSwitchApplication.z_FreieNrItem>.DoExecution-Methode
    Einzelschritt: Microsoft.LightSwitch.Framework.Base.ExecutableObject.Execute-Methode
    Einzelschritt: Microsoft.LightSwitch.Framework.Base.ExecutableObject<System.Collections.Generic.IEnumerable<LightSwitchApplication.z_FreieNrItem>>.Execute-Methode

    In both scenarios, this output is generated when the debugger steps out of the function for the first time. The working project calls "WhereSelectEnumerableIterator<System.Data.Objects.DataClasses.EntityObject,Microsoft.LightSwitch.IEntityObject>.MoveNext", and the non-working project calls "OfTypeIterator<object>.MoveNext".

    And I really don't know why...

    //Edit: Btw, are there any Debug-Symbols for Lightswitch available? It sucks, that one cannot debug this issue...
    Wednesday, January 30, 2013 5:04 PM
  • This is kind of urgent, because it is really a blocking problem. I tried creating a new entity, which does the same, but this fails also. Strange enough, there is another entity that gets called, which doesn't get called twice.
    Thursday, January 31, 2013 7:51 AM
  • Aaaand me again. After three days of bug-hunting and nearly institutionalizing myself, I removed all tables and screens from the project and re-added them. Didn't work. So I saved the Client.lsml, the Common.lsml and the Service.lsml and created a new project. I re-added all the references and copied back the saved lsml's. It works.

    And I don't know why...



    • Edited by DanielGilbert Thursday, January 31, 2013 9:40 AM
    • Marked as answer by Angie Xu Wednesday, February 6, 2013 7:34 AM
    Thursday, January 31, 2013 9:39 AM