The action can't be completed because the file is open in ServiceHub.DataWarehouseHost.exe

Qingdong Fu 0 Reputation points
2024-09-22T04:14:28.89+00:00

Question:

when I am trying to delete a file, the OS refused the action with above pop up window message.

Steps how to reproduce it:

  1. I was developing one of my software, after I built it, I would need to copy the exe and pdb files to another local directory, let's say c:\Temp.
  2. I used Visual Studio community 2022 to attach on one of my running exe (from c:\Temp) to debug some issue
  3. I found some issue in my code, then decided to modify it and try executing it again
  4. I detached the Visual Studio
  5. I modified my code locally, and re-build the exe, then I tried to copy the newly built exe and pdb to c:\Temp
  6. I found that the exe can be copied which replaced the old one, but the copy action for the pdb file was refused by OS. The OS message is:

The action can't be completed because the file is open in ServiceHub.DataWarehouseHost.exe

I also tried to close the Visual Studio, but still failed copy the pdb file to replace the old one.

The VS edition info is following:

Microsoft Visual Studio Community 2022

Version 17.11.3

VisualStudio.17.Release/17.11.3+35303.130

Microsoft .NET Framework

Version 4.8.09032

Installed Version: Community

ADL Tools Service Provider 1.0

This package contains services used by Data Lake tools

ASA Service Provider 1.0

Azure App Service Tools v3.0.0 17.11.231.19466

Azure App Service Tools v3.0.0

Azure Data Lake Tools for Visual Studio 2.6.5000.0

Microsoft Azure Data Lake Tools for Visual Studio

Azure Stream Analytics Tools for Visual Studio 2.6.5000.0

Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools 4.11.0-3.24428.4+1ea9c390a5bb6815fdff2137ee155e23e78d6ff3

C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10

Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub Copilot 0.2.1648.49400

GitHub Copilot is an AI pair programmer that helps you write code faster and with less work.

Microsoft Azure Hive Query Language Service 2.6.5000.0

Language service for Hive query

Microsoft Azure Stream Analytics Language Service 2.6.5000.0

Language service for Azure Stream Analytics

Microsoft JVM Debugger 1.0

Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

NuGet Package Manager 6.11.0

NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

SQL Server Data Tools 17.11.38.0

Microsoft SQL Server Data Tools

ToolWindowHostedEditor 1.0

Hosting json editor into a tool window

Visual Basic Tools 4.11.0-3.24428.4+1ea9c390a5bb6815fdff2137ee155e23e78d6ff3

Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.11.0-beta.24421.7+af2f522de602281d4ef5a7b71507c428e814c5c1

Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2

AI-assisted development for Visual Studio.

WiX Toolset Visual Studio Extension 1.0.0.22

WiX Toolset Visual Studio Extension version 1.0.0.22

Copyright (c) .NET Foundation and contributors. All rights reserved.

The OS info is following:

Edition Windows 11 Home

Version 23H2

Installed on ‎3/‎18/‎2024

OS build 22635.4225

Serial number 0F01GGX22433BF

Experience Windows Feature Experience Pack 1000.22700.1041.0

Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | Visual Studio | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anna Xiu-MSFT 31,056 Reputation points Microsoft External Staff
    2024-09-23T06:40:40.67+00:00

    Hi @Qingdong Fu, 

    Welcome to Microsoft Q&A! 

    Have you tried to restart your computer? 

    I found the ServiceHub.DataWarehouseHost.exe file is located at the folder (C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\ServiceHub\Hosts\ServiceHub.Host.dotnet.x64). 

    You can rename the file and try again. 

    If you have any anti-virus software, please temporarily disable it. 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".  Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Qingdong Fu 0 Reputation points
    2024-10-06T10:43:42.0133333+00:00

    Hi, Anna,

    I tried to rename the exe and tested it a few days. It looks work fine. Thanks for solving my issue. However I am afraid this might just be a workaround, right? I can mark last of your comment as the answer. But I still wish if there could be some better solutions.

    Thanks,

    QD


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.