sqlServerCatalogNameOverwrites in dotnet core 8 where in config file?

Posts   
 
    
kakaiya
User
Posts: 161
Joined: 20-Mar-2004
# Posted on: 09-Apr-2024 17:31:18   

LLBLGen Pro version build 5.10.2.0

Problem occuring at runtime - below in exception

template group - adapter

Using IIS server ONLY (NO Kestrel server) and on Windows 2022 ONLY

.NET version - core v8

database type and version - SQL Server 2022

    <sqlServerCatalogNameOverwrites>
        <add key="INKDEV" value="???INKPROD???" />
    </sqlServerCatalogNameOverwrites>

Exception:

An unhandled exception occurred while processing the request.
SqlException: Invalid object name 'INKDEV.dbo.inkEODSiteStaffName'.
Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, bool breakConnection, Action<Action> wrapCloseInAction)

ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: Invalid object name 'INKDEV.dbo.inkEODSiteStaffName'.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior)

Stack Query Cookies Headers Routing
SqlException: Invalid object name 'INKDEV.dbo.inkEODSiteStaffName'.
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 10-Apr-2024 09:29:11   

If you're using .NET 6+ or .net core 3.x, you have to use the runtime configuration to specify catalog name overwriting, see: https://www.llblgen.com/Documentation/5.11/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/gencode_runtimeconfiguration.htm#multi-tenancy-support-catalog-name-overwriting-sql-server-mysql as the .netstandard build of the runtime doesn't use the config file based configuration settings.

Frans Bouma | Lead developer LLBLGen Pro
kakaiya
User
Posts: 161
Joined: 20-Mar-2004
# Posted on: 10-Apr-2024 11:44:00   

Otis,

Thank you.

How to use below in dotnet core to see SQL?

..... .....

           <add key="ORMProfilerEnabled" value="false" />
</appSettings>
Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 10-Apr-2024 15:18:26   

Please follow the docs