Bug 29398 - [XVS 3.11] "Xamarin.VisualStudio.iOS.Documents" process holds open a reference to the project folder after Visual Studio has exited
Summary: [XVS 3.11] "Xamarin.VisualStudio.iOS.Documents" process holds open a referenc...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.11 (C5)
Hardware: PC Windows
: --- normal
Target Milestone: 3.11.3 (C5SR3)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-04-24 22:30 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2015-07-09 06:44 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2015-04-24 22:30:01 UTC
"Xamarin.VisualStudio.iOS.Documents" process holds open a reference to the project folder after Visual Studio has exited


Regression status: regression, caused by the new docs-sync feature in XVS 3.11.


Android projects have behaved like this for as long as I can remember (due to `adb`), so I'm not sure if this is really a big issue from the perspective of most customers. I hit it frequently because I'm often creating and deleting temporary test projects.


## Steps to reproduce

1. Ensure VS is paired with the Mac build host.

2. Open a Xamarin.iOS project in VS.

3. Quit VS.

4. Attempt to delete the Xamarin.iOS project folder in Explorer.


## Results

Explorer shows a dialog:

> Folder in Use
> 
> The action can't be completed because the folder or a file in it is open in another program
>
> Close the folder or file and try again.


## Workaround

Use Task Manager to kill the "Xamarin.VisualStudio.iOS.Documents" process [1].

> [1] C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Xamarin\Xamarin\3.11.*\DocSync.exe



## Version info

### Windows 8.1 64-bit, in VMWare Fusion 6.0.5 (2209127)

Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641

Xamarin   3.11.445.0 (5061f92)
Xamarin.Android   5.1.0.115 (d23da369e436488f38c8ab8fe8a9ae7d9ea5256b)
Xamarin.iOS   8.10.0.0 (7741cc495ab0baf04ff0405d0604bc27f0ecae2e)


### OS X 10.9.5, MacBook Air

Xamarin.iOS 8.10.0.266 (Business Edition)
Hash: c8648f0
Branch: master
Build date: 2015-04-21 12:22:24-0400
Comment 2 Jose Gallardo 2015-04-28 12:22:00 UTC
We'll investigate this issue for SR2. Moving it accordingly.
Comment 3 Emanuel 2015-07-02 17:39:38 UTC
Fixed in cycle5 branch
commit: 8434886c9f0557f8bee00ae87e86436b9397c93b
wrench: 42c4794aa39025dd6b27a10d71fbb60df2a0d6e9
Comment 4 Mohit Kheterpal 2015-07-03 07:05:24 UTC
Hi Brendan,

Today, I have tried to verify this issue with fixed build, but before verifying this issue I have tried to reproduce this issue with XVS 3.11.445 and observed that I am able to delete X.iOS project folder in explorer when Xamarin.VisualStudio.iOS.Ducumentation exe run in task manager as shown in screencast : http://www.screencast.com/t/ZDhz8itXsR

Could you please help me to reproduce this issue, so that I can verify it efficiently ?

Thanks.
Comment 5 Brendan Zagaeski (Xamarin Team, assistant) 2015-07-08 21:23:12 UTC
Interesting. It is indeed a bit trickier to reproduce than I thought when I first reported it.

I suspect the trickiness is related to the different possibilities for the current working directory when `DocSync.exe` is first started.


## Corrected steps to reproduce

1. Ensure VS is paired with the Mac build host.

2. Quit Visual Studio.

3. Quit `DocSync.exe` if it is already running. (For example, right-click its icon in the task menu and select "Exit".)

4. Open an _existing_ Xamarin.iOS project in VS by double-clicking the solution file in Explorer. (I used a "Visual C# -> iOS -> iPhone -> Single View App" that I created before quitting Visual Studio at step 2.)

5. Quit VS.

6. Attempt to delete the Xamarin.iOS project folder in Explorer.


## Notes

On way to check if `DocSync.exe` has indeed grabbed a handle to the solution directory at step 4 is to use "View -> Lower Pane View -> Handles" in Process Explorer [1].

> [1] https://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2015-07-08 21:28:30 UTC
It might also be worth verifying the fix in a slightly more direct way:

- Does `DocSync.exe` stay running after quitting Visual Studio?

On XamarinVS 3.11.445 it does.

In contrast, at least as I understand it, the fix from comment 3 causes `DocSync.exe` to exit when Visual Studio is quitting. So `DocSync.exe` should _not_ stay running after quitting VS in any branch that contains the commit from comment 3.
Comment 7 Mohit Kheterpal 2015-07-09 06:44:21 UTC
Thanks Brendan.

I am getting same behaviour as you have mentioned in comment 6, i.e. Docsync.exe exited when we close instance of VS as shown in screencast : http://www.screencast.com/t/Rpru7sufY

Using Cycle5 Trunk build of XVS 3.11.755. 

Hence closing this issue.