Bug 9268 - MonoDevelop silently saving files as ".#FileName.cs"
Summary: MonoDevelop silently saving files as ".#FileName.cs"
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 3.0.x
Hardware: PC Windows
: Low normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2013-01-04 12:13 UTC by Allie Miller
Modified: 2013-01-07 06:54 UTC (History)
1 user (show)

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 or GitHub 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:

Description Allie Miller 2013-01-04 12:13:40 UTC
When project files are on a Windows dev machine (because of TFS) and an attempt is made to access them via a SMB share. Frequently, when and attempt is made too save a file, MonoDevelop instead prepends a ".#" to the filename (for example, TaskInfo.cs becomes .#TaskInfo.cs) and saves it with the new filename without notification. The changes are then not reflected when I build the project.

If the file in question has the NTFS ReadOnly attribute, MonoDevelop will reliably produce this behavior. TFS seems to likes to flip this attribute on whenever it checks a file in.

Possibly a issue with SMB, which is then causing the .# in the file names.
Comment 1 Mikayla Hutchinson [MSFT] 2013-01-07 04:54:54 UTC
The reason it does this is so it can ensure the file is written atomically. It writes to this new file, then performs an atomic move over the old file.

It's possible these files are getting left behind, if TFS is setting the "real" file to readonly and the atomic move is failing silently. MD should at the very least be giving an error.  Possibly it should be flipping the readonly bit off the file before saving it.
Comment 2 Mike Krüger 2013-01-07 06:54:02 UTC
As said the .# is by design for security reasons (no data losses caused by blackouts :)).

I fixed the issue by showing an error message that allows you to overwrite the file.