I have an ASP.NET Core web application targeting .NET 8.0, which connects to Oracle using Oracle.ManagedDataAccess.Core 23.6.1 and Oracle.EntityFrameworkCore 8.23.60. The connection works as expected on my development workstation (Windows 10 with Visual Studio 2022). However, after publishing the application to the web server (Windows Server 2022 Datacenter), the connection fails.
I am using an Oracle wallet for authentication and have verified the configurations in appsettings.json, sqlnet.ora, and ojdbc.properties, all of which appear correct. Additionally, I confirmed that the Oracle server is reachable from the web server by running Test-NetConnection -ComputerName “adb.–***–.oraclecloud.com” -Port 1522, which was successful. I also reviewed the firewall settings in the Google Cloud Console.
The error I’m encountering is: Failed to load resource: the server responded with a status of 500 (Internal Server Error). Unfortunately, the IIS logs provide no additional details.
What other steps can I take to troubleshoot why the connection is failing on the web server? Are there specific requirements for IIS in order to connect to Oracle?
Connection String:
"OracleConnection": "User Id=******D; Password=********; Data Source=(description=(retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=adb.us-chicago-1.oraclecloud.com))(connect_data=(service_name=***************_cpsprodapex_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)(my_wallet_directory=C:\CPSPMOReporting\wwwroot\oracle)));",
Controller:
[HttpGet]
public async Task<IActionResult> Get(DataSourceLoadOptions loadOptions) {
var cps_fiss_sop_t = _context.CPS_FISS_SOP_T.Select(i => new {
i.SOP_ID,
i.SOP_NUMBER,
i.SOP_TITLE,
i.SOP_PURPOSE,
i.LAST_REVISE_DATE,
i.AREA_OWNER,
i.LINK_ENGLISH,
i.LINK_TRAINING,
i.ENABLED_FLAG,
i.DEPARTMENT,
i.CATEGORY,
i.CATE
});
// If underlying data is a large SQL table, specify PrimaryKey and PaginateViaPrimaryKey.
// This can make SQL execution plans more efficient.
// For more detailed information, please refer to this discussion: https://github.com/DevExpress/DevExtreme.AspNet.Data/issues/336.
// loadOptions.PrimaryKey = new[] { "SOP_ID" };
// loadOptions.PaginateViaPrimaryKey = true;
return Json(await DataSourceLoader.LoadAsync(cps_fiss_sop_t, loadOptions));
}
3