Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS 2013 temporary file & renaming issue #40

Open
codereflection opened this issue Jul 18, 2013 · 5 comments
Open

VS 2013 temporary file & renaming issue #40

codereflection opened this issue Jul 18, 2013 · 5 comments

Comments

@codereflection
Copy link
Owner

Test support for VS 2013. The SpecWatchr guys (@amirrajan) found that temporary files are getting created, and file renames are occurring with a save in VS 2013.

@amirrajan
Copy link

Here is the reasoning behind it from the VS team:

Thanks for reaching out to us David!

David from our team.

In VS 2013, we have introduced this new disaster recovery feature that helps recover files in case of an unexpected crash. We got a number of customer reports where their files used to get “zeroed out” after a Windows crash event. This feature allows us to preserve the latest possible contents of the file and recover in case of an unexpected event such as a Windows crash.

Thanks,
Murali

From: David Starr
Sent: Sunday, July 21, 2013 11:25 PM
To: Murali Krishna Hosabettu Kamalesha; Amir Rajan
Subject: RE: The shenanigans VS 2013

Murali,

Summary: Visual Studio creates temp files as part of standard file save process.

Do you understand the behavior described below? If not, who might help us learn more?

Thanks!

David Starr

From: Amir Rajan
Sent: Friday, July 19, 2013 8:27 PM
To: David Starr
Subject: The shenanigans VS 2013

Jeff Schumacher (@codereflection) and I develop open source auto tests tools for .Net. Jeff built Giles and I built SpecWatchr. Both of our tools monitor file change events in a given directory. When a file change event occurs, we kick off a build, test run, web deployment or anything else you may want to contextually do when a code file changes.

It turns out that VS 2013 doesn't change .cs files, but instead creates a temporary version and *replaces the original. This photo I took of the file change events shows two temp files getting created..I didn't capture the rename event, but notice that no file changed event for HomeController.cs is raised: https://pbs.twimg.com/media/BPeOrcPCMAAzKQv.jpg:large

We're both just confused. Why would a ctrl+s in VS 2013 create two temp files and then rename the original file (as opposed to just changing the original file)?

Thanks for fielding this question. It's really appreciated!

Amir

@codereflection
Copy link
Owner Author

Sounds like the way around this for now is to handle the rename event. @amirrajan, is that what you've done with SpecWatchr?

It really seems like the VS team is putting a band aide on the problem. I know they cannot do anything about Windows crashing, but why would Visual Studio zero out a file completely? I have to wonder if other IDE's, heck even vim or emacs, has had reports of this problem on Windows. Then again, maybe the complaints the VS team are getting are all from people using TFS. ;)

@amirrajan
Copy link

Yes. Handling for the rename event fixed the issue. Here is the code for reference:

https://github.com/amirrajan/SpecWatchr/blob/master/sidekickapp.cs#L24

and this

https://github.com/amirrajan/SpecWatchr/blob/master/sidekickapp.cs#L65

@amirrajan
Copy link

More issues have cropped up, specifically with Windows 8 + VS 2013. Details here:

https://github.com/amirrajan/SpecWatchr/issues/7#issuecomment-22581729

@amirrajan
Copy link

More updates, looks like the file change issue was fixed, they just didn't tell anyone. That and the file change events are raised in a different order. In other words, SpecWatchr screwed up.

https://github.com/amirrajan/SpecWatchr/issues/7#issuecomment-22593175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants