Magnus Mårtensson
Microsoft Regional Director, Azure MVP, CEO Loftysoft
Avirag Jain
Director & CTO R Systems
Mahesh Chand
Founder C# Corner, CEO Mindcracker
Chris Gali
CEO & Co-Founder Graphite
Subinder Khurana
Chief Architect StoryProcess, Founder NASSCOM DeepTech Club
Bryan Rishforth
Investor, Chairman Graphite
Bryn Everson
Director Biz Dev Graphite
Raj Tiwari
Digital Transformation Leader, Futurist and Visionary
Joseph Guadagno
Microsoft MVP, Lead Quicken Loans
Nikita Sachdev
Entrepreneur, Blockchain Enthusiast & Advisor, Social Media Influencer
Doug Wagner
COO & Founder Adapt Technical Group
Ritesh Modi
Architect, Senior Evangelist, Cloud Architect
Crystal Wenrick
Director Communications Mindcracker
Allen O’Neill
Microsoft MVP, Consulting Engineer/Architect
Praveen Kumar
CEO MCN Solutions
Chris Love
Founder Love2Dev, Microsoft MVP, Author
Sanjay Vyas
Microsoft Regional Director, Microsoft MVP, Founder & CEO SkillLabs Technologies
Veena Sarda
Deep Learning Consultant, Author
Sekhar Srinivasan
C# Corner MVP, Microsoft Certified Trainer, Pluralsight Author
Lalit Bansal
Founder & CEO - EIY SYS
Navdeep Garg
CEO Revinfotech
Prakash Tripathi
Tech Manager/Leader, Microsoft MVP, Blogger
Bhavna Jain
Breakthrough Consultant
Naveen Sharma
Enterprise Architect, Leadership Coach, Author
Vidya Vrat Agarwal
Principal Architect, Microsoft MVP, Author
Sheetal Agarwal
Founder Clownselors, Medical Clown, Trainer
Abhishek Kant
Founder GTM Catalyst
Vishnu Saran
Founder & CEO VoiceQube
Sandeep Soni
Founder & CEO Deccansoft, Microsoft Certified Trainer
Parveen Malik
AVP InfoSec & Vulnerability Management, Information Security Expert
Nitin Pandit
Microsoft MVP, Developer Evangelist, Author
Niloshima Srivastava
C# Corner MVP, Tech Architect, Trainer, Blogger
Bala Chirtsabesan
Senior Software Engineer at Microsoft, Author
Manoj Mittal
Sr. Technical Architect, C# Corner MVP, Author
Chandni Di
Co-Founder Voice of Slum
Vithal Wadje
Technical Lead, Microsoft MVP, Author
Shivam Ahuja
Founder SkillCircle, Business Mentor
Chervine Bhiwoo
Solution Architect, Microsoft MVP, Author
Saurabh Jain
Vice President Paytm, Founder Fun2Do Labs, Author
Vinay Solanki
Head IoT at Lenovo, Founder IoT-NCR
Anshu kumari
Founder Blockchainkids, Inventor, Trainer
Amit Singal
CEO Startup Buddy
Dev Pratap
Co-Founder & CEO Voice of Slum
Amey Vartak
Technology Consultant, Full Stack Developer, C# Corner MVP, Author
Viswanatha Swamy
Principal Software Engineer, C# Corner MVP, Author
Sanket Verma
Research Engineer @ Ballistics (Forensics) and Chair, PyData Delhi
Sourabh Somani
Lead Developer, Microsoft MVP, Author
Abhishek Mishra
Software Architect, C# Corner MVP, Author
Siddharth Vaghasia
Technical Consultant, C# Corner MVP, Blogger
Bassam Alugili
Senior Software Specialist, Database Expert
S Ravi Kumar
Solution Architect, C# Corner MVP, Author
Sundaram Subramanian
Full Stack Developer, C# Corner MVP, Speaker
Deepesh Somani
Solution Architect, Microsoft MVP, Author
Debasis Saha
Technical Project Manager, C# Corner MVP, Blogger, Author
Vipul Jain
Software Architect, C# Corner MVP, Author
Akshay Patel
Technical Architect, Microsoft Certified Trainer, C# Corner MVP, Author
Stephen Simon
RPA Developer, Evangelist, Author
Vivek Sharma
Founder Kingster636, AR/VR Specialist
Jeetendra Gund
Technical Lead, C# Corner MVP, Author
Sujal Beniwal
AI Enthusiast, Student
M Viknaraj
Microsoft MVP, Azure Architect, Author
Prasham Sabadra
Software Architect, C# Corner MVP, Trainer, Author
Aakash Maurya
Senior Developer, C# Corner MVP, Speaker
Ankit Sharma
Senior Software Engineer, C# Corner MVP, Author
Mangesh Gaherwar
Team Lead, C# Corner MVP, Author
Viral Jain
Technical Consultant, C# Corner MVP, Author
Bhasker Das
Solution Architect, Evangelist
Manish Dwivedi
Associate Project Manager
Ck Nitin
Programmer, Author
Rohit Gupta
Technical Trainer, Author
Manish Tewatia
Full-stack Marketer, UX Designer
Bhavya Gaur
Technical Illustrator
Rohit Tomar
SEO/SMO Expert
Web Track
Cloud & Data Track
Dev Track
Registration & Breakfast
Future of Desktop Apps with JS (ElectronJs)
Nitin Pandit
Building Serverless Microservices Using Microsoft Azure
Vithal Wadje
Innovating RPA: A Robot for Every Person
Stephen Simon
Managing Cloud Storage Accounts using Logic Apps
Viknaraj Manogararajah
Data visualization using Python
Sekhar Srinivasan
Going Cross platform with AR Foundation
Vivek Sharma
Keynote
Managing your Azure dependencies in ASP.NET Core apps using VS
Bala Chirtsabesan
Securing Applications on Intelligent Azure
Abhishek Mishra
Getting started with Blazor the Framework of Future
S Ravi Kumar
Lunch
Build Progressive Web Apps using Angular 9
Debasis Saha
Build and deploy to any platform using Azure DevOps
Chervine Bhiwoo
Deep Dive in Azure Service Bus
Akshay Patel
Build a Native Mobile Application using React Native and JavaScript
Joseph Guadagno
Making sense of Web Job, Web Job SDK and Functions in Azure
Prakash Tripathi
CloudFront Distribution in AWS
Viral Jain
Tea Break
Introduction to PowerBI
Aakash Maurya
Build Advanced SPFx solutions with React and Graph API
Siddharth Vaghasia
Build Business Intelligence Analyst (BIA) Skills
Sundaram Subramanian
Deep dive of Power Platform – AI BUILDER
Prasham Sabadra
Panel 1
What's new in SharePoint development
Vipul Jain
Build a SSO (Single Sign On) based Native JavaScript application with Microsoft Identity within 10 minutes
Manoj Mittal
Panel 2
Applications and working of AI
Veena Sarda
Deploying serverless API's with .Net core 3.0 on AWS & Azure
Amey Vartak
Panel 3
Blockchain with .NET Core (Ark)
Anshu Kumari
Closing Note & Prize Distribution
Dev Track
Cloud Track
Architecture Track
Emerging Tech Track
Registration & Breakfast
Creating Full-Stack Web Apps Using Server-Side Blazor
Ankit Sharma
Real time face recognition with MS Cognitive Services
Niloshima Srivastava
Building Scalable APIs with GraphQL
Jeetendra Gund
Future of development with AI and Blockchain
Navdeep Garg
Debugging Tips and Tricks with Visual Studio 2019
Joseph Guadagno
Azure Containers
Abhishek Kant
Enterprise Architecture
Naveen Sharma
Bot Framework - learn it fast and look like a boss!
Allen O’Neill
Keynote
.Net Core & C# 8 Performance
David McCarter
Working with Azure kubernetes services
Ritesh Modi
Becoming an Architect
Vidyavrat Agarwal
Why Techies Need to Learn Product Management
Saurabh Jain
Lunch
Build a rules engine in .Net Core
Sanjay Vyas
Building CI and CD Pipeline using Azure DevOps
Sandeep Soni
Entity Framework Core - Tips and Tricks, Performance Optimization, and Tuning
Bassam Alugili
Hacking your way into Data Science
Sanket Verma
Speed up your .Net Core Website
Sourabh Somani
Azure
Magnus Mårtensson
Demystifying Open Distro for Elasticsearch
Suman Debnath
Future of Data
Shivam Ahuja
Tea Break
gRPC with C# and .Net Core
Mangesh Gaherwar
Panel 1
Essentials of Cloud security
Parveen Malik
Power platform and Dynamics 365
Deepesh Somani
Microservices - the gRPC Way
Viswanatha Swamy
Panel 2
Reserved
Reserved
Closing Note & Prize Distribution
Working With Cancellation Tokens In Long-Running .NET Services
Long-running .NET services rarely operate in a perfectly predictable environment. A worker may process messages for hours, poll an external system overnight, or run a scheduled data pipeline across multiple Australian time zones. At any point, the host can receive a shutdown signal, a deployment can begin, or an operator can cancel a job that is taking too long.
A CancellationToken gives the service a structured way to respond to those events. It does not terminate a thread or forcibly interrupt arbitrary code. Instead, it carries a cancellation request through asynchronous operations so that each part of the application can stop at a safe point.
This cooperative model is especially important for services running in Azure Australia East, Australia Southeast, or a hybrid environment connected to an on-premises data centre. A graceful stop can prevent duplicate messages, abandoned locks, half-written files, and unnecessary load on systems that may be separated by long network paths.
The most reliable implementations treat cancellation as part of normal control flow. They pass tokens through method boundaries, use APIs that observe them, distinguish expected shutdown from genuine failure, and release resources in a predictable order. The result is a service that behaves sensibly during deployments, scaling events, maintenance windows, and the occasional Friday arvo incident.
| Concern | Recommended Approach | Common Mistake |
|---|---|---|
| Host shutdown | Use the token supplied by BackgroundService or the hosting framework |
Creating a new token that ignores the host |
| External calls | Pass the token to HTTP, database, queue, and file APIs | Checking cancellation only before starting the call |
| Multiple stop conditions | Combine tokens with CreateLinkedTokenSource |
Letting one timeout or request signal go unnoticed |
| Exception handling | Treat expected cancellation separately from faults | Logging every OperationCanceledException as an error |
| Cleanup | Use finally, scoped resources, and bounded shutdown work |
Waiting indefinitely during service termination |
Understanding Cooperative Cancellation
A cancellation token is a value that allows one component to notify another that work should stop. The component requesting cancellation owns a CancellationTokenSource; the component performing work usually receives only the associated CancellationToken. This separation prevents worker code from cancelling its own parent operation accidentally.
Cancellation is cooperative because the running code must observe the signal. A loop can call ThrowIfCancellationRequested, inspect IsCancellationRequested, or rely on an awaited API that accepts the token. If a method performs CPU-heavy work without checking the token, cancellation will appear ineffective until that method returns.
public async Task ProcessItemsAsync(
IAsyncEnumerable<Message> messages,
CancellationToken cancellationToken)
{
await foreach (var message in messages
.WithCancellation(cancellationToken))
{
cancellationToken.ThrowIfCancellationRequested();
await HandleMessageAsync(message, cancellationToken);
}
}
The token should travel down the call chain rather than being stored in a global variable. Public service methods, repository operations, HTTP calls, queue clients, and retry policies should accept it where cancellation is meaningful. This makes the behaviour visible, testable, and consistent.
It is useful to distinguish cancellation from failure. A service stopping because Azure App Service, Kubernetes, or the .NET host requested shutdown is generally expected. A database exception, malformed message, or authentication failure may require an error log and a retry. Treating both cases identically can fill monitoring systems with misleading alerts.
Connecting Tokens Across Service Boundaries
Long-running workers commonly have several reasons to stop. The host may be shutting down, a particular operation may have a deadline, and an administrator may request cancellation for a single job. A linked token combines these signals into one token that downstream methods can consume.
public async Task RunJobAsync(
Job job,
CancellationToken stoppingToken)
{
using var timeoutSource =
new CancellationTokenSource(TimeSpan.FromMinutes(20));
using var linkedSource =
CancellationTokenSource.CreateLinkedTokenSource(
stoppingToken,
timeoutSource.Token);
await ExecuteJobStepsAsync(job, linkedSource.Token);
}
The linked source should be disposed when the operation ends. This matters in services that create many per-job sources because each source may register callbacks with its parent tokens. Failing to dispose them can create unnecessary memory use and keep references alive longer than expected.
A timeout should have a clear meaning. A short HTTP timeout may be suitable for an individual request, while a longer job deadline may cover several requests and queue operations. Avoid applying one broad timeout to every layer without considering its work. A database query, a file upload to Melbourne, and a call to a third-party provider may need different limits.
When a request token is combined with a service-wide stopping token, the worker can stop promptly if the caller disconnects or the host is being recycled. For example, an ASP.NET Core endpoint may pass HttpContext.RequestAborted into an application service, while a background processor uses the host stopping token. The application code then remains independent of the source of cancellation.
Handling BackgroundService Shutdown Correctly
BackgroundService provides a practical foundation for hosted workers. Its ExecuteAsync method receives a stopping token, which is signalled when the host begins a graceful shutdown. The worker should pass that token to every operation that should end with the host.
public sealed class ImportWorker : BackgroundService
{
private readonly ImportQueue _queue;
private readonly ILogger<ImportWorker> _logger;
public ImportWorker(
ImportQueue queue,
ILogger<ImportWorker> logger)
{
_queue = queue;
_logger = logger;
}
protected override async Task ExecuteAsync(
CancellationToken stoppingToken)
{
try
{
await foreach (var item in _queue.ReadAllAsync(stoppingToken))
{
await ImportOneAsync(item, stoppingToken);
}
}
catch (OperationCanceledException)
when (stoppingToken.IsCancellationRequested)
{
_logger.LogInformation("Import worker stopping.");
}
}
}
The filtered catch is important. An OperationCanceledException can be raised by a timeout token, a request token, or the host token. Checking the relevant token helps the service report the reason accurately. If cancellation is expected, it usually should not be logged as an application error.
A worker should avoid beginning a new unit of work after cancellation has been requested. This is particularly significant for queue consumers. If a message has already been reserved, the service should complete or abandon it according to the queue system’s semantics. If processing cannot finish before the shutdown deadline, the message should become available for a later attempt rather than being acknowledged prematurely.
Host shutdown time must be configured with realistic limits. A service that needs several minutes to finish a batch cannot rely on a default grace period of only a few seconds. At the same time, unlimited shutdown work can delay deployments and leave orchestration platforms waiting. Use bounded operations and design processing into restartable units.
Making Async Operations Cancellation-Aware
Passing a token to the outer method is insufficient if inner operations ignore it. Task.Delay, HttpClient, many Entity Framework Core methods, channels, and modern Azure SDK operations support cancellation. Use the overload that accepts the token.
await Task.Delay(
TimeSpan.FromSeconds(10),
cancellationToken);
var response = await httpClient.GetAsync(
endpoint,
HttpCompletionOption.ResponseHeadersRead,
cancellationToken);
await dbContext.SaveChangesAsync(cancellationToken);
Polling loops should use cancellable delays rather than a fixed Thread.Sleep. A PeriodicTimer can provide a clean pattern for recurring work:
using var timer = new PeriodicTimer(
TimeSpan.FromMinutes(1));
while (await timer.WaitForNextTickAsync(cancellationToken))
{
await SynchroniseAsync(cancellationToken);
}
For CPU-bound processing, cancellation checks need to occur at sensible intervals. Checking every single instruction is wasteful, while checking only after a large batch may make shutdown feel broken. Break the operation into manageable chunks and check between them. Parallel workloads should pass the token to Parallel.ForEachAsync or the relevant task coordination API.
Cancellation does not undo completed side effects. If a service has charged a customer, published an event, or committed a database transaction, cancelling the next step cannot reverse that action automatically. Use idempotency keys, transactional boundaries, outbox patterns, and durable job state when a stop can occur between related operations.
Testing And Observing Service Cancellation
Cancellation paths need deliberate tests because they often remain invisible during ordinary operation. Create a CancellationTokenSource, start the worker, cancel it while the worker is waiting or processing, and verify that the task finishes within the expected period. Test cancellation during an HTTP request, database call, message handling step, and retry delay.
Useful test cases include:
- Cancellation before a job begins
- Cancellation during a long external call
- A timeout linked with host shutdown
- A second attempt after an interrupted message
Production telemetry should record useful context without treating expected shutdown as an outage. Include the service name, job identifier, operation duration, cancellation source where known, and whether work was completed or retried. Avoid logging sensitive payloads, particularly when services handle health, financial, or government data covered by Australian Privacy Principles.
Operational checks worth monitoring include:
- Time from shutdown signal to worker exit
- Number of abandoned or retried messages
- Jobs exceeding their intended deadline
- External calls that ignore cancellation
- Resources still active after graceful-stop timeout
Australian teams often deploy around customer support windows, public-sector change controls, or busy trading periods. A service in Sydney may be restarted while a dependent system in Perth is still operating, so timestamps should be recorded in UTC with clear local display rules. Azure Monitor, Application Insights, and structured logs can make those cross-region events easier to correlate.
A cancellation-aware design also supports safer scaling. Whether a service runs in a Brisbane office, a Melbourne data centre, or Azure Australia East, instances can stop accepting new work while finishing a bounded operation. That reduces duplicate processing and makes routine maintenance less disruptive. The goal is a service that can stop promptly, preserve its work, and start again without relying on luck.
1, CBD, Maharaj Surajmal Road, Near Yamuna Sports Complex, Delhi, 110032
GENERAL QUERIES
Manish Tewatia
manish@csharpcon.com
+91-9718-431-042
TICKET QUERIES
Atul Gupta
conference@csharpcon.com
+91-9910-125-804