How could I exclude .RefactorLog file while publishing SQL Server databases by SQLPackage.exe?
Actually I never mind these files at all but they potentially could execute unexpected scripts during database publish.
I know that removing them or setting BuildAction=None on them could do the trick, But I look for a way to exclude them at Publish time, even if they exist on my .dacpac file.
Asked
Active
Viewed 593 times
0

Mostafa Armandi
- 879
- 1
- 11
- 24
-
2Well, if you never use it, you could delete it. You could also edit it to remove rename operations that don't make sense before publishing. Not aware of an "exclude" option for the refactor log because it's supposed to be part of the whole process to make sure you don't do table rebuilds when they aren't necessary. – Peter Schott Jun 09 '20 at 16:45
-
While deleting or emptying this file is not my favorite option, I didn’t know that table rebuilt may be happen when renames are not specified on this file. Thanks @PeterSchott – Mostafa Armandi Jun 09 '20 at 19:10
-
you can rename objects without re-factor, but you can loss some data in that case. You can also crate a script that makes build none for that file before publish, then run publish script, and then rollback project file change – Dmitrij Kultasev Jun 10 '20 at 05:15