cannot start profiler .net core

Posts   
 
    
ionut
User
Posts: 16
Joined: 28-May-2019
# Posted on: 01-Mar-2020 15:45:17   

I tried to start the profiler but it is not working.

In startup.cs we used this code:

SD.LLBLGen.Pro.ORMSupportClasses.RuntimeConfiguration.ConfigureDQE<SD.LLBLGen.Pro.DQE.SqlServer.SQLServerDQEConfiguration>(
            c => c.SetTraceLevel(System.Diagnostics.TraceLevel.Verbose)
                  .AddDbProviderFactory(SD.Tools.OrmProfiler.Interceptor.InterceptorCore.Initialize("application name",
                                    typeof(System.Data.SqlClient.SqlClientFactory)))
                  .SetDefaultCompatibilityLevel(SD.LLBLGen.Pro.ORMSupportClasses.SqlServerCompatibilityLevel.SqlServer2012));

            var wrappedType = SD.Tools.OrmProfiler.Interceptor.InterceptorCore.Initialize("application name",
                                              typeof(System.Data.SqlClient.SqlClientFactory));

            SD.Tools.OrmProfiler.Interceptor.InterceptorCore.Initialize("application name", wrappedType);

then in the code I have this usage:


var dataAccessAdapter = new BobyClock.LLBL.Organization.DatabaseSpecific.DataAccessAdapter(connStringBuilder.ConnectionString);

then started ORM Profiler and I pressed Start Recording and then running the application but no activity is recorded in the profiler.

I am using: netcoreapp2.2 SD.Tools.OrmProfiler.Interceptor.NetCore 2.0.2 SD.LLBLGen.Pro.ORMSupportClasses 5.3.0

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 02-Mar-2020 06:31:30   

Hi Iounut,

It looks like it should work. Are you debugging or running a release package? (If so, please check that the necessary dlls are copied to the output folder.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 02-Mar-2020 09:39:11   

Be aware that the data isn't send over the network, so the client has to run on the same machine as your app

Frans Bouma | Lead developer LLBLGen Pro
ionut
User
Posts: 16
Joined: 28-May-2019
# Posted on: 02-Mar-2020 17:14:04   

I double checked and is running in debug mode, and also is on the same machine (development).

I am running from Visual Studio 2019, debug time. Running also everything as administrator. The profiler is silent and no activity recorded whatsoever. Clicked on the button "record to snapshot" but nothing happens.

Wondering if this is because I am using LLBL Gen Pro 5.3 and the Profiler is 2.0 ?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 02-Mar-2020 17:58:03   

No it should work fine. It wraps the factory you specify and the runtime simply uses the wrapped factory. All activity on the objects is then send over a named pipe to the client. I don't think firewalls locally block named pipes.

If you create a simple console app with the same generated code and try to read an entity from the database using the same initialization code as your webapp, do you see activity then?

Frans Bouma | Lead developer LLBLGen Pro
ionut
User
Posts: 16
Joined: 28-May-2019
# Posted on: 04-Mar-2020 11:05:03   

Thanks for the response. My agenda is full right now but when I will have time, I will be back to you with a simple console app.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 04-Mar-2020 20:13:36   

Ok, no worries. I bet it's something simple simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 04-Mar-2020 20:13:56   

I'll close this thread for the time being, it will be automatically reopened when you post a reply. We'll be waiting for your repro.

Thanks.

Meindert
User
Posts: 63
Joined: 07-Nov-2012
# Posted on: 08-Jun-2020 08:54:42   

Hello,

Same thing here, but with Profiler: v1.5 LLBLGen: v5.1 VisualStudio: 16.6.1 .NET: 4.5.2

Program.cs:


        static void Main()
        {
            SD.Tools.OrmProfiler.Interceptor.InterceptorCore.Initialize("CATENA");

            //WindowsFormsSettings.ForceDirectXPaint();

            AppDomain.CurrentDomain.UnhandledException += AllUnhandledExceptions;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
            Application.Run(new MainFormRibbon());
        }

Nu get package: SD.Tools.OrmProfiler.Interceptor.NET45, version: 1.5.20150715

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 08-Jun-2020 09:49:09   

And you're sure there's database activity? As that's not the whole program

Frans Bouma | Lead developer LLBLGen Pro
Meindert
User
Posts: 63
Joined: 07-Nov-2012
# Posted on: 08-Jun-2020 10:21:34   

No it is not the whole program and yes there is database activity!

I have to mention, I remember now, that we override DataAccessAdapter.

Could I give more information, please let me know?!

Meindert
User
Posts: 63
Joined: 07-Nov-2012
# Posted on: 08-Jun-2020 15:15:43   

I'm not on .NET core, as the original writer is, I could make a new Issue if you like?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 08-Jun-2020 20:18:20   

What changes did you make to the adapter? The main issue is that if the factory isn't wrapped, (which is done by the interceptor initialize), the original factory is used and therefore no calls are intercepted.

Also, as v2.0.2 of ormprofiler is free for you, could you try the v2 version and see if it fixes it for you?

Frans Bouma | Lead developer LLBLGen Pro
Meindert
User
Posts: 63
Joined: 07-Nov-2012
# Posted on: 09-Jun-2020 07:26:49   

Like to try the latest profiler, but where can I find it?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 09-Jun-2020 07:49:45   

Meindert wrote:

Like to try the latest profiler, but where can I find it?

If you have a valid LLBLGen Pro license you should be able to download the latest ORM Profiler: Go to https://www.llblgen.com -> My Account -> Downloads -> OrmProfiler.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 09-Jun-2020 12:25:20   

If you grab the SqlClient factory from DbProviderFactories: var factory = DbProviderFactories.GetFactory("System.Data.SqlClient"); and check the type (after InterceptorCore is called), is it a Profiler* type or is it System.Data.SqlClient.SqlClientFactory ? (please write out the type in full, as the tostring can be misleading)

If it's SqlClientFactory, the overwriting of the DbProviderFactory table hasn't succeeded, and the factory isn't wrapped (causing no data to be send). If the type is a Profiler* type, the factory is wrapped and the data might not be accepted by the client, which is the case if the client runs on another machine (as the connection is over a named pipe).

Other than that it's weird, as here everything works fine in that kind of setups.

Frans Bouma | Lead developer LLBLGen Pro