Strange possible shadow copy issue when two editors show different content

I have code that reads the configuration file, but when I open the file in TextPad, I see different values ​​than my application. I checked it with Notepad. Notepad agrees with my application, TextPad shows something else.

This is in Vista x64 Business.

Any idea what could be causing this? I looked at the details of the Context Menu->Properties->Previous Versions , but it says: "No versions available."

Here are the steps for replication (I cannot do this reliably):

  • Installed .NET application in program files.
  • This application reads the configuration file, but crashes.
  • I will manually edit this configuration file in Textpad.
  • The change does not take effect.
  • I open the configuration file in Notepad and see something else.
  • Try to make changes to Notepad and save and get this error message:

Notebook

Unable to create file C: \ Program Files (x86) \ Daniel Schaffer \ WorkingOn for FogBugz \ FogBugz> WorkOn.exe.config.

Make sure the path and file name are correct.

I can’t put content here like this is XML and is encoded by Superuser.com, but here is a link to screencast: http://screencast.com/t/zhERl7mocp4 .

+4
source share
5 answers

It seems that the case when you do not have an administrator when installing the application. Sometimes, when you install an application without any admins, it behaves very strange due to the vista security model. I had a similar problem with this last year. This was not entirely true, but it was strange behavior until I realized that it was a Vista security model. He takes it to the security context of the application / user, from what I know, because my brain froze when I read about it, as it was pure muck and almost useless from what I see.

Try opening the text panel (great application) using "Run as administrator", and then edit the configuration. See what happens. If he then remains the same, then his problem brings. If this does not work, uninstall the application and install it as an administrator. This will give the application access to the administrators of the administrator letters. Then when you edit the configuration. See if this works.

Take a look at this. You can raise the application to run under administrator control using the methods found here. How to lift the application. . Try all this before reinstalling.

If this does not work, send your question to the server error. Also post it on the appropriate MSDN forum.

Hope this helps. Bean.

+3
source

It is interesting. I assume that the Vista function works here called UAC Virtualization (aka Data Redirection). It basically redirects obsolete applications to %USERPROFILE%\AppData\VirtualStore\Program Files\... so that they can write files to the program directory.

Perhaps Textpad is trying to open the file in read-write mode while your application and Notepad use it for read-only use? You can run Process Monitor to see the exact magic, and please let me know; -)

+2
source

Try simply removing this space character from the application name; my guess is related to the construction of the canonical path

+1
source

try copying the file to another path and reopening it. see if it changes the result.

0
source

One thing you can do is to observe which exact file each of these methods opens. For this

  • run Process Monitor from the sysinternal package.
  • Look only at file operations (deselect the registry settings to the right of the toolbar)
  • select only your own process (filter out all processes that you do not need, or just include your own process name in the filter list)

You can also just use the search function for your file name, it could be a faster route.

The process monitor has helped me find so many problems that it is amazing.

0
source

All Articles