accele
05/11/2024, 7:39 PMaccele
05/12/2024, 5:56 PMweedroid
05/13/2024, 8:54 AMaccele
05/13/2024, 8:54 AMaccele
05/13/2024, 8:56 AMaccele
05/13/2024, 8:56 AMweedroid
05/13/2024, 8:57 AMaccele
05/13/2024, 8:57 AMaccele
05/13/2024, 9:15 AMaccele
05/13/2024, 9:15 AMweedroid
05/13/2024, 9:16 AMweedroid
05/13/2024, 9:16 AMaccele
05/13/2024, 9:29 AMaccele
05/13/2024, 9:29 AMkdx-perbol
05/13/2024, 9:58 AMappSettings.x.json
. Also, isn't there a log entry that shows part of the connection string? Or at least the database configuration. VS will set the ASPNETCORE_ENVIRONMENT
but an IIS site will get it from Web.config
or machine/site configurationaccele
05/13/2024, 11:06 AMkdx-perbol
05/13/2024, 12:03 PMstdoutLogEnabled
and/or start Umbraco manually (from the command-line), does it say anything?accele
05/13/2024, 3:03 PMaccele
05/13/2024, 3:04 PMaccele
05/13/2024, 3:07 PMaccele
05/13/2024, 3:10 PMkdx-perbol
05/13/2024, 4:51 PMProgram.cs
without even a class... or is that Umbraco source code you're stepping through somehow? It looks curiously similar to Umbraco 9 code. Is this an upgraded project?kdx-perbol
05/13/2024, 4:52 PMUmbracoApiController
) and dump IConfiguration
, are there any `umbracoDbDsn`s in there? Or anything at all from your appSettings.accele
05/14/2024, 7:51 AMaccele
05/14/2024, 8:06 AMaccele
05/14/2024, 8:13 AMaccele
05/14/2024, 8:17 AMkdx-perbol
05/14/2024, 10:12 AMaccele
05/14/2024, 10:47 AMSebastiaan
05/14/2024, 10:52 AMdotnet publish -c Release -o .\release
uses Release
configuration (-c Release
) and in turn that uses the appsettings.Production.json
.
I can't remember how exactly though, which is annoying. But are you sure that you have an appsettings.Production.json
and that contains the correct sql connection string?
Otherwise, everything falls back to appsettings.json
(unless there's environment variables on the server, they take precedence) so if a value is not in appsettings.Production.json
, it will use the appsettings.json
setting instead. So before you deploy, you can also just ONLY provide appsettings.json
and have the correct connection string in there.
All of this is not magic, we're using dotnet default behavior for this.accele
05/14/2024, 10:54 AMSebastiaan
05/14/2024, 10:54 AMdotnet publish -c Release
etc, but it will not influence which appsettings file is used. The SERVER has server variables forcing that string.accele
05/14/2024, 10:54 AMSebastiaan
05/14/2024, 10:55 AMaccele
05/14/2024, 10:55 AMaccele
05/14/2024, 10:55 AMkdx-perbol
05/14/2024, 10:57 AMSebastiaan
05/14/2024, 10:57 AMASPNETCORE_ENVIRONMENT
- https://stackoverflow.com/questions/46364293/automatically-set-appsettings-json-for-dev-and-release-environments-in-asp-net-c
If it's set to Development
, appsettings.Development.json
is used, if set to Production
, appsettings.Production.json
is used, etc.Sebastiaan
05/14/2024, 10:59 AMappsettings.*.json
files, usually they give you access to environment variables, even if it's just read-only, that might help determine if something is wrong.kdx-perbol
05/14/2024, 10:59 AMProgram.cs
. So I don't understand how you can get the pre-13 "Startup"-style code.accele
05/14/2024, 11:00 AMaccele
05/14/2024, 11:01 AMaccele
05/14/2024, 11:01 AMSebastiaan
05/14/2024, 11:01 AMaccele
05/14/2024, 11:01 AMaccele
05/14/2024, 11:02 AMkdx-perbol
05/14/2024, 11:02 AMaccele
05/14/2024, 11:04 AMaccele
05/14/2024, 11:04 AMSebastiaan
05/14/2024, 11:46 AMkdx-perbol
05/14/2024, 12:06 PMlocalhost\SQLEXPRESS01
the correct SQL server instance for the non-working environment? Are you sure that instance is working and reachable on that address? Usually .
is used for localhost
with Windows & SQL Server. If that instance isn't running or isn't reachable it would give the timeout error after a while. Easiest way to test is to run SSMS on the server and attempt to connect to localhost\SQLEXPRESS01
or .\SQLEXPRESS01
. Also, SQL Server needs to be configured to use the correct protocols; I don't think the default client settings will use anything other than TCP to connect.accele
05/14/2024, 1:09 PMaccele
05/14/2024, 1:09 PMaccele
05/14/2024, 1:10 PMaccele
05/14/2024, 1:11 PMaccele
05/14/2024, 1:32 PMSebastiaan
05/14/2024, 2:39 PMmmusameh
- noting that if you create the solution in Visual Studio, it might just be to uncheck a box 🤔A hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by