azure-webjobs-sdk-extensions: Getting lots of "Unable to aquire Singleton lock" during localhost development
Heya š
So Iāve just started playing around / trying to use the TimerTrigger
with a new webjob. Iām doing localhost development to make sure the code works, before I deploy it up to Azure.
To do this, I click F5
to Debug
my webjob console app. Ok, great! works/etcā¦ I then stop this (or the code throws an exception and crashes).
I then change one tiny thing and then hit F5
again ā¦ and then get this:
Sometimes, I wait 10 or even 20 seconds after the webjob stopped/stops and then hit F5
and still get that error.
Shouldnāt the host 100% tear down after itās stopped? I should be able to hit F5
, then close app, then hit F5
straight away, right?
Update / More info.
Hereās my program.cs
as a reference:
class Program
{
// Please set the following connection strings in app.config for this WebJob to run:
// AzureWebJobsDashboard and AzureWebJobsStorage
static void Main()
{
var config = new JobHostConfiguration();
config.Tracing.ConsoleLevel = TraceLevel.Verbose;
config.UseTimers();
var host = new JobHost(config);
host.RunAndBlock();
//var host = new JobHost();
//// The following code ensures that the WebJob will be running continuously
//host.RunAndBlock();
}
}
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 15 (7 by maintainers)
Ok, Iāve added
JobHostConfiguration.IsDevelopment
andJobHostConfiguration.UseDevelopmentSettings()
. You can see an example in the extensions sample here. This new method sets up all the optimal local dev settings as mentioned above.See the xml doc on these new methods for details. Basically if your environment has a setting AzureWebJobsEnv, IsDevelopment will be true. Note that these changes are in prerelease packages available on myget.
Iām all for that š Was just thinking about options, but yes! all for that š
e.g.:
<Setting name="AzureConnectionString" value="UseDevelopmentStorage=true" />