Posts

Showing posts with the label .net-core

C# .net Core reconnect to Oracle after database enabled

C# .net Core reconnect to Oracle after database enabled I have .net Core web-api project in docker, where I connect to Oracle database. For connecting I use nugget package oracleClientCore How I connect and call stoted procedure: string cs = "Data Source = 172.10.200.100:1521/dev;PERSIST SECURITY INFO=True;USER ID=test; Password=devtest;"; using (OracleConnection connection = new OracleConnection(cs)){ connection.Open(); using (OracleCommand cmd = connection.CreateCommand()) { cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "sp_check_db"; cmd.ExecuteNonQuery(); connection.Close(); } } In stored procedure sp_check_db just make insert into table sp_check_db insert into table Sometimes the connection to database falling down and I got exception ORA-03114: not connected to ORACLE . After the database was enabled again I continue to receive same error ORA-03114: not connected to ORACLE till I rebuild and redeploy the project. ORA...

Asp.Net Core API disable startup complete message

Image
Asp.Net Core API disable startup complete message As part of my application I have a .Net Core API project. Unlike most cases where this project would run as its own process, I have the API run in a thread, among others, in a single process. Also for my project, I have implemented a custom logging system to suit my needs. However, I have come across a slight problem. Every time I run my program, once the API starts, this message is printed to the console: Hosting environment: Production Content root path: C:UsersPathToCode Now listening on: http://*:8000 Application started. Press Ctrl+C to shut down. I would like to disable this message as there is no need for it, and it clutters up the otherwise well organized console log. I have a screenshot below so you know exactly what I'm talking about: I have already disabled all other logging for the mvc (removed ILoggerFactory from ConfigureServices and set all logging to "None" in appsettings.json ). ILoggerFactory ConfigureS...