Tasks
56 TopicsEntire Task List Lost
Last week, I had been working most of the day, when my entire task list was suddenly lost. There is nothing. No completed tasks, no in progress, none of the recurring ones. Everything is gone, and this is going to really disrupt my work for... who knows how long. Is there any way to get them back?210Views3likes11CommentsTasks tab does not load
At a customer the tasks tab in the Project-app in PowerApps refuses to load by a specific user. Last week I was there for a training and it seemed the same problem occurred to me as well. The correct url's are already added to the pop-up (known issue). The tasks tab will only load after deleting cookies and other browser history; this has to be done with every browser session. It al worked fine untill recently. What could be the issue here?36Views1like1CommentMention people in the comments of Tasks
How do you mention someone in the comments section of a task? I've seen other queries about this dating back to 2017, and in 2019 Microsoft said they are working on it... so has this been done? Example: My colleague and I have been assigned a task - to upload content onto the website. In the checklist it notes my colleague will write the content, and then I will upload it. I'm trying to tag her in my comment to say, "@ let me know when the copy is ready for me to upload." Is there actually no way to do this?10KViews3likes10CommentsTask assignments and overall task % completion
Hi! Most probably this might not be possible in MS Project / Project Online, but it doesn’t hurt to check with the Project Community. We have a task assigned to two resources, and the Project Manager's idea is that either of these two resources can complete the whole task to 100%, not only their 50% of it. We have tried various combinations of Fixed Duration / Work / Units with and without Effort Driven but haven’t found any combination that works so one of the two resources can complete the task to 100%. It always ends up being half. For example, the resource goes to My Tasks and submits 80%, but in the project, it shows 40%. We have also looked into using the Team Resource option, but it requires the resources to take an extra step, assigning the task from the Team to themselves, which is not what we are looking for. Does this requirement have any solution, or should we stop investigating and give up? Thank you.96Views0likes1CommentIntroducing the all-new 'My Day' view in 'Tasks by Planner and To Do' App for Microsoft Teams!
Feeling overwhelmed by tasks from multiple sources and struggling to stay organized? We have great news for you! We are thrilled to introduce the 'My Day' view in the 'Tasks by Planner and To Do' app for Microsoft Teams. This feature aims to help you effectively organize and prioritize your tasks, consolidate your task lists, and declutter your workspace.35KViews4likes37CommentsFire-and-Forget Methods in C# — Best Practices & Pitfalls
When building modern applications, there are often situations where you want to perform tasks in the background without holding up the main flow of your application. This is where “fire-and-forget” methods come into play. In C#, a fire-and-forget method allows you to run a task without awaiting its completion. A common use case is sending a confirmation email after creating a user, but this also brings some limitations, particularly when dealing with scoped services. In this blog, we’ll walk through an example and explain why scoped services, like database contexts or HTTP clients, cannot be accessed in fire-and-forget methods. Why Fire-and-Forget? Fire-and-forget is useful in situations where you don’t need the result of an operation immediately, and it can happen in the background, for example: Sending emails Logging Notification sending Here’s a common scenario where fire-and-forget comes in handy: sending a welcome email after a user is created in the system. public async Task<ServiceResponse<User?>> AddUser(User user) { var response = new ServiceResponse<User?>(); try { // User creation logic (password hashing, saving to DB, etc.) _context.Users.Add(user); await _context.SaveChangesAsync(); // Fire-and-forget task to send an email _ = Task.Run(() => SendUserCreationMail(user)); response.Data = user; response.Message = user.FirstName + " added successfully"; } catch (Exception ex) { // Error handling } return response; } The method SendUserCreationMail sends an email after a user is created, ensuring that the main user creation logic isn’t blocked by the email-sending process. private async Task SendUserCreationMail(int id) { // This will throw an exception be _context is an scoped service var user = await _context.Users.FindAsync(id); var applicationUrl = "https://blogs.shahriyarali.com" string body = $@" <body> <p>Dear {user.FirstName},</p> <p>A new user has been created in the system:</p> <p>Username: {user.Username}</p> <p>Email: {user.Email}</p> <p>Welcome to the system! Please use the provided username and email to log in. You can access the system by clicking on the following link:</p> <p><a href='{applicationUrl}'>{applicationUrl}</a></p> <p>Best regards,</p> <p>Code With Shahri</p> </body>"; var mailParameters = new MailParameters { Subject = $"New User Created - {user.Username}", Body = body, UserEmails = new List<UserEmail> { new() { Name = user.FirstName, Email = user.Email } } }; await _mailSender.SendEmail(mailParameters); } In the code above, the SendUserCreationMail method is executed using Task.Run(). Since it's a fire-and-forget task, we don’t await it, allowing the user creation process to complete without waiting for the email to be sent. The Problem with Scoped Services A major pitfall with fire-and-forget tasks is that you cannot reliably access scoped services (such as DbContext or ILogger) within the task. This is because fire-and-forget tasks continue to run after the HTTP request has been completed, and by that point, scoped services will be disposed of. For example, if _mailSender was scoped services, they could be disposed of before the SendUserCreationMail task completes, leading to exceptions. Why Can’t We Access Scoped Services? Scoped services have a lifecycle tied to the HTTP request in web applications. Once the request ends, these services are disposed of, meaning they are no longer available in any background task that wasn’t awaited within the request lifecycle. In the example above, since the fire-and-forget email sending isn’t awaited, attempting to use scoped services will throw an ObjectDisposedException. To safely access scoped services in a fire-and-forget method, you can leverage IServiceScopeFactory to manually create a service scope, ensuring that the services are available for the task. private async Task SendUserCreationMail(int id) { // Create a service scope. using var scope = _serviceScopeFactory.CreateScope(); var _context = scope.ServiceProvider.GetRequiredService<DataContext>(); var user = await _context.Users.FindAsync(id); var applicationUrl = "https://blogs.shahriyarali.com" string body = $@" <body> <p>Dear {user.FirstName},</p> <p>A new user has been created in the system:</p> <p>Username: {user.Username}</p> <p>Email: {user.Email}</p> <p>Welcome to the system! Please use the provided username and email to log in. You can access the system by clicking on the following link:</p> <p><a href='{applicationUrl}'>{applicationUrl}</a></p> <p>Best regards,</p> <p>Code With Shahri</p> </body>"; var mailParameters = new MailParameters { Subject = $"New User Created - {user.Username}", Body = body, UserEmails = new List<UserEmail> { new() { Name = user.FirstName, Email = user.Email } } }; await _mailSender.SendEmail(mailParameters); } Conclusion Fire-and-forget methods in C# are useful for executing background tasks without blocking the main application flow, but they come with their own set of challenges, particularly when working with scoped services. By leveraging techniques like IServiceScopeFactory, you can safely access scoped services in fire-and-forget tasks without risking lifecycle management issues. Whether you're sending emails, logging, or processing notifications, ensuring proper resource management is crucial to prevent errors like ObjectDisposedException. Always weigh the pros and cons of fire-and-forget and consider alternative approaches like background services or message queuing for more robust solutions in larger systems. To explore more on this topic, you can check out the following resources on Microsoft Learn: Task.Run Method Task asynchronous programming model9.8KViews2likes2CommentsEditing multiple entries in Planner, e.g. using a quick edit view, a fill handle or the like
There should be a way to quickly edit one property of several tasks in Planner - for example setting a due date. What I have in mind is the fill handle in Excel or the Quick Edit View in SharePoint task lists. As far as I know, this is missing (also see answers below). If so, it seems to me to be a small but highly significant feature request. Regards Jo122Views1like2CommentsTask with multiple resources showing as multiple rows in Power BI table; instead of just the one row
Question please. I have Project on the Web schedule with many tasks, and some have multiple resources assigned. When I pull the tasks into a table in Power BI report I am getting a row for each task with the resource, instead of the task listing both resources on one row. So if there are 4 resources, the task shows 4 times, once per resource. The tables tasks and resources have a relationship, so is this the way it is supposed to work? How can I just show a list of unique tasks and all the resources assigned in one row per task? Grouping of some sort? So 1 task with 4 resources, shows as 1 task with 4 resources all in one row. Thank youSolved146Views0likes3CommentsShared ToDo deleted tasks > how to restore?
Hello everyone, We share a ToDo with my colleagues and I deleted some tasks by mistake. I tried to restore them but whitout success. I cannot find any place where those deleted items went. I tried a lot a of solutions found on the net but none of them worked. I also point out that those tasks were not mine. So I am looking for some help. Does anyone have an idea or even a solution about that?63Views0likes0Comments