Try using PostCustomCommand and run a batch file there which creates the .ignore file.
PostCustomCommand