1

Resolved

Null reference exception debugging a query

description

Excited to try this out, but when I tried running a query generated by Excel (as given by OLAP PivotTable Extensions), I got the following null reference exception:
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at MdxScriptDebugger.MdxScriptDebugger.GetDistinctCellProperties(CellSet queryResult, String propertyName)
   at MdxScriptDebugger.MdxScriptDebugger.DebugMdxScript(String query)
   at MdxScriptDebugger.MdxScriptDebuggerGUI.bDebugMdxScript_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18444 built by: FX451RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
MdxScriptDebugger
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/me/Downloads/MdxScriptDebugger.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.34238 built by: FX452RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Microsoft.AnalysisServices
    Assembly Version: 11.0.0.0
    Win32 Version: 11.0.5058.0 ((SQL11_PCU_Main).140514-1623 )
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.AnalysisServices/11.0.0.0__89845dcd8080cc91/Microsoft.AnalysisServices.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
Microsoft.AnalysisServices.AdomdClient
    Assembly Version: 11.0.0.0
    Win32 Version: 11.0.5058.0 ((SQL11_PCU_Main).140514-1820 )
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.AnalysisServices.AdomdClient/11.0.0.0__89845dcd8080cc91/Microsoft.AnalysisServices.AdomdClient.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


Cheers,
Nigel

comments

gbrueckl wrote Nov 14, 2014 at 2:29 PM

Hi Nigel,
thanks for the Feedback,
the issue should be fixed with the new release from November 9th
can you try this?

-gerhard

nigelharris wrote Nov 19, 2014 at 12:37 PM

Gerhard,

Yes, that fixes the null reference, thanks.

Not sure if I'm missing something, though - now I can run it, the only line I get highlighted is the "CALCULATE;" line, even if I am querying, say, a YTD calculated measure...

Regards,
Nigel

gbrueckl wrote Nov 19, 2014 at 3:22 PM

Well, the tool helps you to analyze the performance of assignments (basically SCOPE statements)
if your reference query contains a calculated measure and no line is highlighted except the "CALCULATE" this actually means that you have no assignments that change the value of your query at any time

if this query has performance problems then these problems are related to the used calculated measure(s) and not to any assignments. In this case you need to investigate into the used calculated measure(s) and their MDX

-gerhard

nigelharris wrote Nov 19, 2014 at 4:04 PM

Gerhard,

Ah, yes, it wasn't a measure affected by a scope statement but now I've tried it with one that is, I can see the results.

Thanks - handy tool!

Regards,
Nigel

wrote Nov 19, 2014 at 4:29 PM