David Bellerose
Variables syntax
So for anyone reading this I had to swap the two properties on either side of the "??" null-coalescing operator. For some reason the original first part
_appSettings.TMDBSettings.BaseUrl
, being local, should return null on Railway but somehow didn't. I assume it evaluated to something other than null, so the second part of the statement after the ?? was never evaluated. Swapping them allowed the Environment variable to be evaluated first, which returns null locally, but works on Railway since the Environment variable is evaluated first, and is successfully picked up on Railway by the app.
var baseUrl = Environment.GetEnvironmentVariable("BaseUrl") ?? _appSettings.TMDBSettings.BaseUrl;
At least that's my theory.29 replies
Variables syntax
I don't believe so, It is .net mvc 6, I haven't had a need to create a docker file for my .net 6 apps. I did for my .net 8 blazor apps though.
I commented out this part in the line 110 I posted above just to test if the "??" part of the line isn't working. Redeploying now. I'll post the result in a few minutes
29 replies
Variables syntax
So the int32 is the count of records to retrieve from the api, and the debugger shows that it is passing into the method correctly, it is not a variable set in the Railway app. From what I can tell the lines of code I posted above, the BaseUrl for example is set as a string. So I'm still thinking that the app can't see the Railway variable for some reason
29 replies
Variables syntax
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
An unhandled exception has occurred while executing the request.
System.NullReferenceException: Object reference not set to an instance of an object.
at MoviePro.Services.TMDBMovieService.SearchMoviesAsync(MovieCategory category, Int32 count) in /app/Services/TMDBMovieService.cs:line 110
29 replies