Options

Business Central OnPremise – Microsoft AL connected to SQL Server by .NET

sserranosserrano Member Posts: 5
Hi,

I have replicated the code, but when build it gives me the following error. I've done my research, but I not find anything.
https://robertostefanettinavblog.com/2023/06/22/business-central-onpremise-microsoft-al-connected-to-sql-server-by-net/

Error:

[2023-07-27 17:18:31.80] Publishing AL application using launch configuration 'BCTEST'.
[2023-07-27 17:18:32.19] Targeting server 'http://localhost', server instance 'BC220' and tenant 'default'.
[2023-07-27 17:18:32.19] Using Windows authentication.
[2023-07-27 17:18:32.21] Sending request to http://localhost:7049/BC220/dev/metadata?tenant=default
[2023-07-27 17:18:32.84] Publishing package to tenant 'default'
[2023-07-27 17:18:32.84] Sending request to http://localhost:7049/BC220/dev/apps?tenant=default&SchemaUpdateMode=synchronize&DependencyPublishingOption=default
[2023-07-27 17:18:38.05] Error: An error occured while processing the request.
Request ID: XXXXXXXXXXXXXXXXXXX
Session ID: XXXXXXXXXXXXXXXXXXX

If you are targeting a cloud instance, supply these IDs if contacting Microsoft support.
[2023-07-27 17:18:38.06] The request for path /BC220/dev/apps?tenant=default&SchemaUpdateMode=synchronize&DependencyPublishingOption=default failed with code UnprocessableEntity. Reason: Extension compilation failed
PROYECTO/CODEUNITS/Cod50000.X.al(114,20): error AL0132: 'DotNet "System.Data.SqlClient.SqlCommand"' does not contain a definition for 'CommandText'
PROYECTO/CODEUNITS/Cod50000.X.al(115,20): error AL0132: 'DotNet "System.Data.SqlClient.SqlCommand"' does not contain a definition for 'CommandTimeout'

The version it uses is (On prem)
ES Business Central 22.1 (Plataforma 22.0.56191.0 + Aplicación 22.1.55890.56216)

Thanks,






Best Answer

  • Options
    DiddyByPDiddyByP Member Posts: 1
    Answer ✓
    Hi Sserrano,

    Thanks for this post ( i have been pulling my hair out)

    Can I ask how the assemble looks in AL
    struggling to find the correct assembly name...

    umufqrorito4.png


    Cheers

Answers

  • Options
    MarHanMarHan Member Posts: 33
    Hi sserrano,

    these two things seem to have been removed in the platform dlls with BC22.x. We also used them in two of our objects and had now to refactor it. Unfortunately my devs forgot to link the pull request when closing the work item so I'm currently not able to give you a clue what they did 🤷🏻‍♂️

    Regards

    Markus
  • Options
    MarHanMarHan Member Posts: 33
    Oh wait, I was wrong, the code they commented out a couple of weeks ago is now active again, however the workitem was closed - need to do further investigation on this issue - after my holidays :-)
  • Options
    sserranosserrano Member Posts: 5
    Solution. Thanks for comment.

    They have changed assembly. In BC22. X. Instead of using System.Data.SqlClient is Microsoft.Data.SqlClient.

  • Options
    MJVMJV Member Posts: 38
    I have a similar issue but my problem is that Microsoft.Data.SqlClient is not installed on the server which is compiling the app when I publish it. Does anyone know what to install to get the assembly onto the machine?

    Thanks,

    Michael
  • Options
    sserranosserrano Member Posts: 5
    edited 2023-11-10
    You can take the assembly, place it in your project and in the project indicate where it is located. I think that with that, it would work.
    MJV wrote: »
    I have a similar issue but my problem is that Microsoft.Data.SqlClient is not installed on the server which is compiling the app when I publish it. Does anyone know what to install to get the assembly onto the machine?

    Thanks,

    Michael
  • Options
    DiddyByPDiddyByP Member Posts: 1
    Answer ✓
    Hi Sserrano,

    Thanks for this post ( i have been pulling my hair out)

    Can I ask how the assemble looks in AL
    struggling to find the correct assembly name...

    umufqrorito4.png


    Cheers
  • Options
    sserranosserrano Member Posts: 5
    edited 2023-11-17
    Hi DiddyByP ,

    You have to change the name of the assembly
    DiddyByP wrote: »
    Hi Sserrano,

    Thanks for this post ( i have been pulling my hair out)

    Can I ask how the assemble looks in AL
    struggling to find the correct assembly name...

    umufqrorito4.png


    Cheers

    o6j855ggkpmx.png

Sign In or Register to comment.