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

sserranosserrano Member Posts: 3
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,






Answers

  • MarHanMarHan Member Posts: 23
    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
  • MarHanMarHan Member Posts: 23
    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 :-)
  • sserranosserrano Member Posts: 3
    Solution. Thanks for comment.

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

Sign In or Register to comment.