If you found value in this post, consider following me on X @davidpuplava for more valuable information about Game Dev, OrchardCore, C#/.NET and other topics.
"It works on my machine" but not when I'd build a docker image and using it in production.
Story of my life.
Changes I'd make and run locally worked as expected on my dev machine. But when I'd deploy them to production, they wouldn't be there.
More specifically, I was forked an open source library to make a change I needed.
I then rebuilt the Nuget package, stored it in a local nuget repository source and referenced that local nuget package in my app.
I would run the app locally on my dev machine and, boom, the change works flawlessly.
To move the change to production, I built a new docker image and deployed that new image to the production server.
AHHHH!!! The change wouldn't show up, even though I know I'm running the new image.
After many hours of insanity, quite literally trying the same thing over and over expecting different results, I finally realized the cause of my problem.
The Dockerfile I used to build the docker container has no knowledge or access to the local nuget feed on my dev machine.
Why did it take so long to realize this?
Because the opensource library I was using is available publicly on nuget.org. And the source of my frustration was that I did NOT, I repeat, I DID NOT, use a different/unique/not-currently-used-on-nuget-dot-org version number (laziness, I guess).
So, everything build without error. But the build process would grab the nuget package from nuget.org which did NOT have my changes that I packaged into the local nuget feed version of the same library.
I solved this problem by
After I made that change, the new docker image work as expected in the production environment.
If you found value in this post, consider following me on X @davidpuplava for more valuable information about Game Dev, OrchardCore, C#/.NET and other topics.