Does anybody here know why SystemRestore monitors .cs files

  • Thread starter Thread starter Anthony Wieser
  • Start date Start date
A

Anthony Wieser

Any idea how to switch off monitoring of this particular extension. It
doesn't seem to monitor any other kind of files that are similar in nature.
I did a system restore today, and found all my work vanished back to the
restore point. Thought I'd point it out before it happens to anyone else.
Luckily undo restore got them back.
 
Could it be because those files were stored at an improper location rather
than based on file extension (if I remember to monitor locations rather than
specific extensions on the whole volume ?).

But an admin group for your OS would be better as the problem is with System
Restore not with CSharp...
 
Thanks for your reply.

I just wondered if there was a csharp reason for making it onto the list of
extensions used here:
http://msdn.microsoft.com/en-us/library/aa378870(VS.85).aspx

There's nothing potentially executable about .cs files is there?

Also, thought it was more relevant to people who might lose files.


Patrice said:
Could it be because those files were stored at an improper location
rather than based on file extension (if I remember to monitor locations
rather than specific extensions on the whole volume ?).

But an admin group for your OS would be better as the problem is with
System Restore not with CSharp...



Anthony Wieser
Wieser Software Ltd
 
Indeed. I'd really like to know where those .cs files were stored.

How do you know they are missing if you don't know where they were stored
;-)

The default is to store projects somewhere under My Documents\Visual Studio
2008
 
Starts to be interesting. Actually I don't known about most of those
extension anyway.

I don't remember to have ever used system restore but my impression was that
only specific locations were monitored. Your files were under MyDocuments ?

A search shows you are not alone and yes My Documents is immune in XP but
subject to System Restoration in Vista... (according to
http://www.vistax64.com/vista-gener...-deleted-lots-my-cs-files-vista-ultimate.html).
Don't known about Windows 7 (I'm one of those few guys still using XP ;-))

Would worth a blog post on a C# dedicated blog ! I retract my first thought.
This is perfectly relevant here !!!
 
Any idea how to switch off monitoring of this particular extension.  It
doesn't seem to monitor any other kind of files that are similar in nature.
I did a system restore today, and found all my work vanished back to the
restore point.  Thought I'd point it out before it happens to anyone else.
Luckily undo restore got them back.

Hopefully you have Source Control?!!! If not you can install Perforce
for free. See my blog post @ http://tinyurl.com/ny3l9m

-- Alan
 
Hopefully you have Source Control?!!! If not you can install Perforce
for free. See my blog post @http://tinyurl.com/ny3l9m

-- Alan

And it goes without saying that it should be installed on a different
hard drive or server!!

Chris
 
Patrice said:
How do you know they are missing if you don't know where they were stored
;-)

The default is to store projects somewhere under My Documents\Visual
Studio 2008

They were stored under C:\projects\etc...
however, apparently under vista, they're not safe under "My Documents" etc
either.

Anthony Wieser
Wieser Software Ltd
 
Chris said:
And it goes without saying that it should be installed on a different
hard drive or server!!

Chris

Alas, the files were not checked into source control.

And you need a souurce control system that doesn't use any of the extensions
listed for its files either, or else system restore could become really
interesting...

Anthony Wieser
Wieser Software Ltd
 
Thanks for your reply.

I just wondered if there was a csharp reason for making it onto the list
of extensions used here:
http://msdn.microsoft.com/en-us/library/aa378870(VS.85).aspx

There's nothing potentially executable about .cs files is there?

Well, you can always compile them and then execute them. Some uses of .cs
files might actually include shipping custom .cs files or auto-generating
them at the client computer and then compiling them there. (Ill-advised,
IMHO...but it wouldn't surprise me if there's at least one program out
there that does that).

Another possibility is that the ".cs" extension found its way onto the
list by virtue of something other than its relationship to VS/C#. There's
nothing to ensure that file extensions are unique to a single program, and
that lack of uniqueness is more of a problem the shorter the file
extension.

For example, a Google search suggests there are at least eight or nine
different possible uses for ".cs" as an extension, including as "Czech
language translation file", which could in fact be considered an OS
component depending on how it's used (I'm not expert enough in the
mechanisms of localizations, so I don't know how relevant, if at all, that
is).
Also, thought it was more relevant to people who might lose files.

Thought what was more relevant? System Restore? Or something else?
System Restore is about recovering the system to a known-good state after
something has happened to the executable parts, such as software
installation, corruption, malware, etc. It's not really about losing
files.

In any case, it seems to me that the really crucial question, which has
already been asked but not answered, is where were your .cs files when
they got "restored"? System Restore shouldn't be affecting files in user
document directories, and your .cs files should only be in your user
document directories. So the fact that the .cs extension is on the list
of "files System Restore monitors" shouldn't be relevant; your .cs files
should be safe by virtue of being outside the area of the disk that System
Restore manages.

Pete
 
They were stored under C:\projects\etc...
however, apparently under vista, they're not safe under "My Documents"
etc either.

What do you mean by "under 'My Documents'"? On Vista, the user document
folders are now under the root level "\Users" directory, and the Windows
Explorer UI isn't the same as it was in XP. But they definitely should be
untouched by System Restore if you have them in the _actual_ user
documents folder, even on Vista (and Windows 7).

On the other hand, if you stored the files in "C:\projects\etc", then it
doesn't surprise me at all if System Restore modified them, since that's
not a user document folder.

Pete
 
Back
Top