AssetDatabase.Refresh working differently after upgrade from 3.4 to 3.5.

To facilitate build branching, we have a little script that runs and replaces a “config” text file before we build our game. In Unity 3.4, I would replace the config file and then call AssetDatabase.Refresh() to have the database pick up the changes to the text file.

However, the same script in Unity 3.5 doesn’t appear to work right. Though the config file is updated on the file system, Unity does not pick up on the change after calling AssetDatabase.Refresh(). Unity does see the change if I minimize/maximize the Unity window or if I focus/unfocus the Unity window. It also works if I right-click on the asset and click ‘Refresh’. But I need a way to do it through script.

Any thoughts on why this would work in 3.4, but not 3.5? Thanks!

I’ve got some more data that might be helpful.

My original order of operations that worked in 3.4 was this:

  1. Delete config.txt
  2. Copy new version of config.txt
  3. AssetDatabase.Refresh().

What I got to work correctly in 3.5 was this:

  1. Delete config.txt
  2. AssetDatabase.Refresh()
  3. Copy new version of config.txt
  4. AssetDatabase.Refresh()

As I said, focusing/unfocusing the Unity window correctly catches the change - could this be a bug in the Refresh() function not identifying that a file has been modified? Or is this the desired behavior?