Azure Functions Cannot access a disposed of object

2.2k views Asked by At

I am converting HTML to pdf using NReco in azure functions. It used to work properly but when I deployed in another slot I am getting below error.

Assembly reference changes detected. Restarting host...
Environment shutdown has been triggered. Stopping host and signaling shutdown.
completed successfully
Function completed (Success, Id=d5042f25-18d9-489a-81fe-05ae07607012, Duration=10921ms)
Executed 'AzureBillFunc' (Succeeded, Id=d5042f25-18d9-489a-81fe-05ae07607012)
The host started (12276ms)
A ScriptHost error has occurred
Microsoft.Azure.WebJobs.Host: Cannot access a disposed of object. Stopping Host

can I know what's happening in the above steps?

1

There are 1 answers

1
mugabits On

You are trying to access the object host.json but it is disposed. In other words, not available.

This happens when the object is utilized by another process, so it is possible that you have another instance running, or holding up a reference. I recommend closing all your terminals to terminate all process.

For function app version 2, if you do not have a host.json file, it will automatically create one for you with the following content:

{
  "version":"2.0"
}