Download code:
x gist 0b0c91549135dbe9ce550e05e800aefb
Publish
dotnet publish -c Release
Copy to IIS, setup with an App Pool w.
- "No Managed Code"
- Recycling 1 min
Go to the IIS folder for the website, where you copied the files. Then run a Migrate (I had to use an admin window for this) .\disposetest.exe --AppTasks=migrate Then I had to use Windows permissions to give Everyone full-control on the db_new.sqlite file.
Start the web site.
Init data: http://localhost/ui/HelloInit
Call Hello: http://localhost/ui/Hello
Every time you call, the name should be changed a bit, just to see that we're able to read/write from DB.
PART 2 -- the tester
Inside the "callerapp" folder start "dotnet run". It'll call the URL "http://localhost/Hello over and over, and it'll show if there's an error.
Due to the recycling of IIS, sometimes we should get "Service Unavailable". We can also trigger recycling ourselves in UI of IIS on the App Pool.
When we're lucky, the log should just show:
2025-01-07 10:38:08.604 +01:00 [INF] Before Exec Filter 2025-01-07 10:38:08.604 +01:00 [INF] Before Exec Filter 2025-01-07 10:38:08.604 +01:00 [INF] Before Exec Filter 2025-01-07 10:38:08.819 +01:00 [INF] AppHost is disposing...
Then a new log (002, 003, etc) is usually created where the newly restored app continues:
2025-01-07 10:38:10.177 +01:00 [INF] Initializing Application disposetest took 207.8025ms. No errors detected. 2025-01-07 10:38:11.331 +01:00 [INF] Before Exec Filter 2025-01-07 10:38:11.815 +01:00 [INF] Before Exec Filter
And when we're really lucky, we get our problem:
2025-01-07 10:39:07.873 +01:00 [INF] Before Exec Filter 2025-01-07 10:39:07.874 +01:00 [INF] Before Exec Filter 2025-01-07 10:39:08.540 +01:00 [INF] Before Exec Filter 2025-01-07 10:39:08.909 +01:00 [INF] AppHost is disposing... 2025-01-07 10:39:08.945 +01:00 [INF] Before Exec Filter 2025-01-07 10:39:08.946 +01:00 [ERR] Incorrect JsonTypeSerializer.Instance.ObjectDeserializer. FIXING 2025-01-07 10:39:08.946 +01:00 [ERR] AppHost is disposed 2025-01-07 10:39:08.946 +01:00 [INF] Before Exec Filter 2025-01-07 10:39:08.946 +01:00 [ERR] AppHost is disposed
The error message is from the check within the ORMLite pre-Exec filter. Sometimes we get one error, sometimes more: