Print Page | Close Window

LINQPad Exception

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3290
Printed Date: 13-May-2026 at 9:40am


Topic: LINQPad Exception
Posted By: Thomas
Subject: LINQPad Exception
Date Posted: 23-Feb-2012 at 11:09am
When I try to use an executable (the dll was already tested with a WPF client) I always get the following error (the config file contains the correct connection string):

Message: Object reference not set to an instance of an object. 
RemoteExceptionName null  
RemoteExceptionDetails null  
RemoteSource null  
RemoteStackTrace null  
FailureType Other 
OperationType Query 
Cancelled False 
Data IDictionary (0 items) 

TargetSite: EntityManager.HandleEntityServerException (Exception ex, Boolean tryToHandle, PersistenceOperation operation, Boolean throwOnError)

StackTrace:  IdeaBlade.EntityModel.EntityManager.HandleEntityServerException(Exception ex, Boolean tryToHandle, PersistenceOperation operation, Boolean throwOnError)
    IdeaBlade.EntityModel.EntityManager.ExecuteServerQuery(IEntityQuerySurrogate entityQuery)
    IdeaBlade.EntityModel.EntityManager.ExecuteFetch(IEntityFinder finder)
    IdeaBlade.EntityModel.EntityQueryFinder.Execute()
    IdeaBlade.EntityModel.EntityManager.ExecuteQueryCore(IEntityQuery query, Boolean isAsync)
    IdeaBlade.EntityModel.EntityManager.ExecuteQuery[T](IEntityQuery`1 query)
    IdeaBlade.EntityModel.EntityQueryExtensions.Execute[T](IEntityQuery`1 query)
    IdeaBlade.EntityModel.EntityQuery`1.System.Collections.IEnumerable.GetEnumerator()
    LINQPad.ObjectGraph.ListNode..ctor(ObjectNode parent, IEnumerable list, Int32 maxDepth, DataContextDriver dcDriver, String name)
    LINQPad.ObjectGraph.ListNode..ctor(ObjectNode parent, IEnumerable list, Int32 maxDepth, DataContextDriver dcDriver)
    LINQPad.ObjectGraph.ObjectNode.Create(ObjectNode parent, Object item, Int32 maxDepth, DataContextDriver dcDriver)
    LINQPad.ObjectGraph.ObjectNode.Create(Object item, Nullable`1 maxDepth, DataContextDriver dcDriver)
    LINQPad.ObjectGraph.Formatters.XhtmlWriter.WriteDepth(Object value, Nullable`1 maxDepth, Action`1 onClick)
    LINQPad.ObjectGraph.Formatters.XhtmlWriter.WriteLineDepth(Object value, Nullable`1 maxDepth, Action`1 onClick)
    LINQPad.Extensions.Dump[T](T o, String description, Nullable`1 maximumDepth, Boolean toDataGrid, Action`1 onClick)
    LINQPad.Extensions.Dump[T](T o, String description, Nullable`1 maximumDepth)
    LINQPad.Extensions.Dump[T](T o)



Replies:
Posted By: kimj
Date Posted: 23-Feb-2012 at 1:47pm
Unfortunately that exception is obscuring the real problem.  LINQPad lets you drill into exceptions, so can you see if you can open up the inner exception(s) and see the stack trace for it?
 
You should give the driver the assembly holding your model.  So if your model is in a DLL, that's what you should give the driver, not the .exe.  Of course, if your model is in the .exe, point LINQPad to that.
 
Can you also tell me which version of DevForce and the DevForce LINQPad driver you're using?


Posted By: Thomas
Date Posted: 23-Feb-2012 at 8:46pm
Driver version is 1.0.2 and DevForce 6.1.5.1 and I already used the correct file (in this case the dll with the model). I also tried it with projects that only had one executable which contained the application and the model but I got the same error.


Posted By: kimj
Date Posted: 24-Feb-2012 at 9:24am
OK, see if you're able to drill into the inner exception(s) so we get a better stack trace. 


Posted By: Thomas
Date Posted: 24-Feb-2012 at 9:53am
Inner exception: (there is only one)

NullReferenceException
Message Object reference not set to an instance of an object. 
 
 
StackTrace     IdeaBlade.EntityModel.EntityServerProxy.CheckConnection(Exception e)
    IdeaBlade.EntityModel.EntityServerProxy.ExecFunc[T](Func`1 func, Boolean funcWillHandleException)
    IdeaBlade.EntityModel.EntityServerProxy.ExecuteOnServer[T](Func`1 func, Boolean funcWillHandleException)
    IdeaBlade.EntityModel.EntityServerProxy.Fetch(SessionBundle bundle, IEntityQuerySurrogate query)
    IdeaBlade.EntityModel.EntityManager.ExecuteServerQuery(IEntityQuerySurrogate entityQuery) 
HelpLink null  
Source IdeaBlade.EntityModel 



Posted By: kimj
Date Posted: 24-Feb-2012 at 10:05am
Thanks.  Unfortunately the trace still doesn't have enough information to diagnose the problem.  
 
The debug log will usually be generated when running within LINQPad.  It will be written to whatever location is specified in your config or the bin folder - was a debug log generated and does it have anything that might help?


Posted By: Thomas
Date Posted: 24-Feb-2012 at 10:39am
That is what I get (It seems that there is a problem with finding the license information ... but this is working perfectly fine when the exe is started within visual studio).


<?xml version="1.0"?><?xml-stylesheet href="DebugLog.xsl" type="text/xsl"?><log>
<entry id="11" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.TraceFileXmlLogger:GetLogHeader">------------ Log Created ------------</entry>
<entry id="0" timestamp="2012-02-24T19:36:06" username="" source="IdeaBlade.Core.IdeaBladeConfig:Initialize">Initializing configuration ...</entry>
<entry id="1" timestamp="2012-02-24T19:36:06" username="" source="IdeaBlade.Core.Composition.PartsCatalog:LoadCatalog">MEF assembly probing started: 24.02.2012 19:36:06.  If this takes a long time, use IdeaBlade.Core.Composition.CompositionHost to specify/restrict which assemblies to probe.</entry>
<entry id="2" timestamp="2012-02-24T19:36:07" username="" source="IdeaBlade.Core.Composition.PartsCatalog:LoadCatalog">MEF assembly probing completed: 24.02.2012 19:36:07</entry>
<entry id="3" timestamp="2012-02-24T19:36:07" username="" source="IdeaBlade.Core.Composition.CompositionHost:.ctor">Probe Assemblies: LINQPad, Version=1.0.0.0, Culture=neutral, PublicKeyToken=21353812cd2a2db5  If this list is unnecessarily large, use CompositionHost.SearchPatterns to modify the search critieria for probed assemblies. If this list does not contain the assembly(ies) holding your a) domain model, b) custom interface implementations, and c) POCO/known types then your application may not work correctly. Ensure that these assemblies are available in the exe/bin folder, and if using CompositionHost.SearchPatterns that the patterns are set appropriately.</entry>
<entry id="4" timestamp="2012-02-24T19:36:07" username="" source="IdeaBlade.Core.IdeaBladeConfig+&lt;&gt;c__DisplayClass2:&lt;Initialize&gt;b__1">Cannot find a valid license key in any domain model assembly. 


 -- Check the following: 
 1) Make sure that your model assembly is available in the bin/exe folder. 
 2) Check that all referenced assemblies are available, including all necessary IdeaBlade assemblies. 
 3) Set CopyLocal=true for all IdeaBlade references to ensure these assemblies are copied to this folder. 
Check the debuglog for additional messages.</entry>
<entry id="5" timestamp="2012-02-24T19:36:07" username="" source="IdeaBlade.Core.IdeaBladeConfig+&lt;&gt;c__DisplayClass2:&lt;Initialize&gt;b__1">Falling back and using License from Registry</entry>
<entry id="6" timestamp="2012-02-24T19:36:07" username="" source="IdeaBlade.Core.Configuration.ServerSettingsElement:ConstrainSettingsBasedOnLicenseCore">The configured SupportedClientApplicationType is Both</entry>
<entry id="7" timestamp="2012-02-24T19:36:07" username="" source="IdeaBlade.Core.Configuration.ServerSettingsElement:ConstrainSettingsBasedOnLicenseCore">Could not find a valid license to enable session-agnostic load balancing.</entry>
<entry id="8" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.Configuration.ServerSettingsElement:ConstrainSettingsBasedOnLicenseCore">Could not find a valid license to enable session-agnostic load balancing.</entry>
<entry id="9" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.Composition.CompositionHost:CheckMultiExport">CompositionContext: '-IbDefault-' - Probed for non-default 'ITraceLoggerProvider' and found no matching exports.</entry>
<entry id="10" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.Composition.CompositionHost:CheckSingleExport">CompositionContext: '-IbDefault-' - Probed for default 'ITraceLoggerProvider' and found 'IdeaBlade.Core.DefaultLoggerProvider'.</entry>
<entry id="12" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.TraceFns:CompleteTracingInitialization">IdeaBladeConfig resolution: File: G:\Users\Eggi\Documents\Visual Studio 2010\Projects\WpfApplication9\WpfApplication9\bin\Debug\WpfApplication9.exe.config - found</entry>
<entry id="13" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.TraceFns:CompleteTracingInitialization">IdeaBladeConfig resolution: Logging file: G:\Users\Eggi\Documents\Visual Studio 2010\Projects\WpfApplication9\WpfApplication9\bin\Debug\DebugLog.xml</entry>
<entry id="14" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.TraceFns:CompleteTracingInitialization">Bound to .NET runtime version 4.0.30319.17020</entry>
<entry id="15" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.TraceFns:CompleteTracingInitialization">DevForce version 6.1.5.1</entry>
<entry id="16" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.EntityModel.EntityServerProxy:CreateInstance">Loaded IdeaBlade.EntityModel.EntityServerProxy</entry>
<entry id="17" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.Composition.CompositionHost:CheckSingleExport">CompositionContext: '-IbDefault-' - Probed for default 'IDataSourceKeyResolver' and found 'IdeaBlade.EntityModel.DefaultDataSourceKeyResolver'.</entry>
<entry id="18" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.Composition.CompositionHost:CheckSingleExport">CompositionContext: '-IbDefault-' - Probed for any 'EntityServiceApplication' and found 'IdeaBlade.EntityModel.EntityServiceApplication'.</entry>
<entry id="19" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.EntityModel.EntityServiceApplication:OnServiceStartup">EntityService created</entry>
<entry id="20" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.EntityModel.EntityService:get_LocalInstance">Created local EntityService</entry>
<entry id="21" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.EntityModel.Server.EntityServer:.ctor">EntityServer created for DataSourceExtension: [None], CompositionContext: -IbDefault-</entry>
<entry id="22" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.Composition.CompositionHost:CheckMultiExport">CompositionContext: '-IbDefault-' - Probed for any 'ICompositionContextResolver' and found no matching exports.</entry>
<entry id="23" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.Composition.CompositionHost:CheckMultiExport">CompositionContext: '-IbDefault-' - Probed for any 'IEntityQueryExecutor' and found 'IdeaBlade.EntityModel.Edm.EdmQueryExecutor'.</entry>
<entry id="24" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.Composition.CompositionHost:CheckMultiExport">CompositionContext: '-IbDefault-' - Probed for any 'IEntityQueryExecutor' and found 'IdeaBlade.EntityModel.Edm.PassthruEsqlQueryExecutor'.</entry>
<entry id="25" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.Composition.CompositionHost:CheckMultiExport">CompositionContext: '-IbDefault-' - Probed for any 'IEntityQueryExecutor' and found 'IdeaBlade.EntityModel.Edm.StoredProcQueryExecutor'.</entry>
<entry id="26" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.Composition.CompositionHost:CheckMultiExport">CompositionContext: '-IbDefault-' - Probed for any 'IEntityQueryExecutor' and found 'IdeaBlade.EntityModel.Edm.UdtQueryExecutor'.</entry>
<entry id="27" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.EntityModel.Server.SessionManager:GetLoginManager">Anonymous access: enabled</entry>
<entry id="28" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.Core.Composition.CompositionHost:CheckSingleExport">CompositionContext: '-IbDefault-' - Probed for non-default 'IEntityLoginManager' and found no matching exports.</entry>
<entry id="29" timestamp="2012-02-24T19:36:08" username="" source="IdeaBlade.EntityModel.Server.SessionManager:GetLoginManager">No Login Manager found. User will always be logged in as Guest, regardless of credentials.</entry>
<entry id="30" timestamp="2012-02-24T19:36:08" username="Guest - 1" source="IdeaBlade.Core.Composition.CompositionHost:CheckSingleExport">CompositionContext: '-IbDefault-' - Probed for any 'EntityServerQueryInterceptor' and found 'IdeaBlade.EntityModel.Server.EntityServerQueryInterceptor'.</entry>
</log>


Posted By: kimj
Date Posted: 24-Feb-2012 at 11:10am
It's also curious that no probe assemblies are found.
 
Within LINQPad, if you right-click on the connection to open the properties window:
 -  "Path to model assembly" should point to your assembly.  For example:
    G:\Users\Eggi\Documents\Visual Studio 2010\Projects\WpfApplication9\WpfApplication9\bin\Debug\MyDomainModel.dll
 
 - "Full name of EntityManager" - should be found automatically from the assembly
 
 - "Application config file" - here would probably be:
    G:\Users\Eggi\Documents\Visual Studio 2010\Projects\WpfApplication9\WpfApplication9\bin\Debug\WpfApplication9.exe.config
 
Based on the debug log, DevForce isn't finding your model assembly, yet it's finding LINQPad.exe.  You probably want to install LINQPad under Program Files.  Since it's here in your exe folder, are you by chance working directly with the DevForce LINQPad Driver source?
 


Posted By: Thomas
Date Posted: 24-Feb-2012 at 11:19am
I could now solve the problem by downloading their installer version  (4.31)  and it works there without any problems.

Maybe you could check out if 4.38.03 is working for you ( http://www.linqpad.net/Beta.aspx - http://www.linqpad.net/Beta.aspx ) because this version seems to produce the error.


Posted By: kimj
Date Posted: 24-Feb-2012 at 2:44pm
Although I'm not getting the same error you did, I am seeing problems with some models with the LINQPad Beta.  We'll have to check it out, thanks for the heads up!



Print Page | Close Window