1
votes

I am just learning Azure data lake analytics and U-SQL. I have a simple script that runs and produces the expected output. However when I set a breakpoint in the code behind helper method it is never hit because no symbols have been loaded. I have looked at all the available Microsoft tutorials and none suggest that I must do anything to enable debugging, it should just work when I run.

  • I am running on Local.
  • I am using F5 to run in debug mode.
  • Script completes successfully.
  • Output confirms that helper method is executed

U-SQL

@searchlog = 
EXTRACT UserId          int, 
        Start           DateTime, 
        Region          string, 
        Query           string, 
        Duration        int, 
        Urls            string, 
        ClickedUrls     string
FROM "/SearchLog.tsv"
USING Extractors.Tsv();

@searchlog = SELECT
            UserId,
            DataLake.Helper.Test() AS Test,
            Start, 
            Region, 
            Query, 
            Duration, 
            Urls, 
            ClickedUrls
    FROM @searchlog;


OUTPUT @searchlog 
TO "/SearchLog_output.tsv"
USING Outputters.Tsv();

Code Behind

namespace DataLake
{
public class Helper
{
    public static string Test()
    {
        Console.WriteLine("Stop");
        return "Test";
    }
}
}

Output Window

'DebugHost.exe' (CLR v4.0.30319: DefaultDomain): Loaded.
'C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561
934e089\mscorlib.dll'. Symbols loaded.
'DebugHost.exe' (CLR v4.0.30319: DefaultDomain): Loaded 
'C:\Users\ksmith\Documents\Visual Studio 
2017\Projects\USQLApplication1\DataLake\bin\LocalDebug\DebugHost.exe'. 
Symbols loaded.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded 
'C:\Users\ksmith\Documents\Visual Studio 
2017\Projects\USQLApplication1\DataLake\bin\LocalDebug\Microsoft.Cosmos
.ScopeStudio.BusinessObjects.Debugger.dll'. Cannot find or open the PDB 
file.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded 
'C:\Users\ksmith\Documents\Visual Studio 
2017\Projects\USQLApplication1\DataLake\bin\LocalDebug\Microsoft.Cosmos
.ScopeStudio.BusinessObjects.Common.dll'. Cannot find or open the PDB file.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded 
'C:\Users\ksmith\Documents\Visual Studio 
2017\Projects\USQLApplication1\DataLake\bin\LocalDebug\Microsoft.Analytics
.LocalRun.dll'. Cannot find or open the PDB file.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded 
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c56
1934e089\System.dll'. Symbols loaded.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded 
'C:\Users\ksmith\Documents\Visual Studio 
2017\Projects\USQLApplication1\DataLake\bin\LocalDebug\Microsoft.Cosmos.
ClientTools.Shared.dll'. Cannot find or open the PDB file.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded 
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__
b77a5c561934e089\System.Core.dll'. Symbols loaded.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded 
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b
77a5c561934e089\System.Xml.dll'. Symbols loaded.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded 
'C:\Users\ksmith\Documents\Visual Studio 
2017\Projects\USQLApplication1\DataLake\bin\LocalDebug\ScopeRuntime.exe'. 
Cannot find or open the PDB file.
The program '[28036] DebugHost.exe' has exited with code 0 (0x0).

Can anyone shed some light on why the breakpoints are not hit?

Adding Debugger.Launch(); caused the Choose Just-In-Time Debugger window to appear. If I select one of the options I then get an instance of visual studio were the code behind break points are hit. The VS instance is called LocalVertexHost

JIT Debugger

Thanks

3
You should be able to do what you are describing. How do you know no symbols are loaded? It would help if you share the version of VS and the ADL plug-in that you are using. We can take a look at the script and VS project you have if you share those privately with the tools team at: bigdatatools (at) Microsoft dot com.OmidA
Could you please do a build clean then F5, then check if there are $(ProjectDirectory)\bin\debug\XXXXX_ScriptFileName_YYYY__codebehind_zzzz.dll and .pdb ? That are the dynamically generated dll and pdb of your code behind assembly. After you confirmed that these all exist, you could pause in the debugger to see if the dll has been loaded in "modules" and try to load that pdb file from there to see if that symbol can be loaded or not.Yu Dong Yang
I have tried using VS 2015 - ADL 2.2.2100.0 and VS 2017 - ADL 2.2.9000.1. The code behind dll and pdb files are created in LocalDebug folder but it does not appear in the modules windowksmith
Can you try the following code and see what happens ? public static string Test() { Debugger.Break(); Console.WriteLine("Stop"); return "Test"; } Also, there should be " -- Attached LocalVertexHost" messages in the Output/Debug panel.Yu Dong Yang
Output window content added to postksmith

3 Answers

0
votes

It is some issue that the extension of DataLake Analytics has for visual studio. I have had, and still having, this issue. Follow these steps and it can be ok for some runs, then repeat it again:

  1. Clean all the projects you have: ADLA and ADLA Class library;
  2. Make sure that the debug folders are empty on both projects;
  3. Rebuild and Register to your local ADLA the Class Library with the code behind;
  4. Rebuild the script you are trying to debug;
  5. Make the ADLA project your startup project;
  6. Submit the script to your local ADLA (makes sure that you have all the needed files in debug and that the script is assigned as the startup script);
  7. After the submit is successful, put the brak point into the code behind;
  8. Start debugging;

If the breakpoint is not hit yet, then try to delete everything from the local U-SQL temporary folder and repeat again all the steps.

0
votes

This happenes in my environment me when I click the Submit button in Visual Studio instead of hitting F5 or clicking on start (with debugging). Thought I should share even though you mention already running with f5 because this was the only mention of this issue I could find. Maybe this will be helpful to others.

I think clicking submit runs the usql script in a separate process without the debugger attached.

-1
votes

Go to the Debug options in Visual Studio and ensure the following:

  • Uncheck "Enable Just My Code"
  • Check "Suppress JIT optimization on module load"