'How to exclude system files from Windows installer project that get added to it automatically?
I've inherited a Visual Studio solution that uses some sort of Windows Installer project (it's built as MSI) that started giving me these warnings and errors during the build:
WARNING: 'credui.dll' should be excluded because its source file 'C:\Windows\system32\credui.dll' is under Windows System File Protection.
WARNING: 'credui.dll' should be excluded because its source file 'C:\Windows\system32\credui.dll' is under Windows System File Protection.
WARNING: 'CRYPT32.dll' should be excluded because its source file 'C:\Windows\system32\CRYPT32.dll' is under Windows System File Protection.
WARNING: 'CRYPT32.dll' should be excluded because its source file 'C:\Windows\system32\CRYPT32.dll' is under Windows System File Protection.
WARNING: 'WTSAPI32.dll' should be excluded because its source file 'C:\Windows\system32\WTSAPI32.dll' is under Windows System File Protection.
WARNING: 'WTSAPI32.dll' should be excluded because its source file 'C:\Windows\system32\WTSAPI32.dll' is under Windows System File Protection.
WARNING: 'MSIMG32.dll' should be excluded because its source file 'C:\Windows\system32\MSIMG32.dll' is under Windows System File Protection.
WARNING: 'MSIMG32.dll' should be excluded because its source file 'C:\Windows\system32\MSIMG32.dll' is under Windows System File Protection.
WARNING: 'IMM32.dll' should be excluded because its source file 'C:\Windows\system32\IMM32.dll' is under Windows System File Protection.
WARNING: 'IMM32.dll' should be excluded because its source file 'C:\Windows\system32\IMM32.dll' is under Windows System File Protection.
WARNING: 'Secur32.dll' should be excluded because its source file 'C:\Windows\system32\Secur32.dll' is under Windows System File Protection.
WARNING: 'Secur32.dll' should be excluded because its source file 'C:\Windows\system32\Secur32.dll' is under Windows System File Protection.
WARNING: 'gdiplus.dll' should be excluded because its source file 'C:\Windows\system32\gdiplus.dll' is under Windows System File Protection.
WARNING: 'gdiplus.dll' should be excluded because its source file 'C:\Windows\system32\gdiplus.dll' is under Windows System File Protection.
WARNING: 'COMDLG32.dll' should be excluded because its source file 'C:\Windows\system32\COMDLG32.dll' is under Windows System File Protection.
WARNING: 'COMDLG32.dll' should be excluded because its source file 'C:\Windows\system32\COMDLG32.dll' is under Windows System File Protection.
WARNING: 'oledlg.dll' should be excluded because its source file 'C:\Windows\system32\oledlg.dll' is under Windows System File Protection.
WARNING: 'oledlg.dll' should be excluded because its source file 'C:\Windows\system32\oledlg.dll' is under Windows System File Protection.
WARNING: 'bcrypt.dll' should be excluded because its source file 'C:\Windows\system32\bcrypt.dll' is under Windows System File Protection.
WARNING: 'bcrypt.dll' should be excluded because its source file 'C:\Windows\system32\bcrypt.dll' is under Windows System File Protection.
WARNING: 'OLEACC.dll' should be excluded because its source file 'C:\Windows\system32\OLEACC.dll' is under Windows System File Protection.
WARNING: 'OLEACC.dll' should be excluded because its source file 'C:\Windows\system32\OLEACC.dll' is under Windows System File Protection.
ERROR: 'UxTheme.dll' should be excluded because its source file 'C:\Windows\system32\UxTheme.dll' is under Windows System File Protection.
ERROR: 'UxTheme.dll' should be excluded because its source file 'C:\Windows\system32\UxTheme.dll' is under Windows System File Protection.
WARNING: 'System.Runtime.dll' should be excluded because its source file 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll' is under Windows System File Protection.
WARNING: 'System.Runtime.dll' should be excluded because its source file 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll' is under Windows System File Protection.
WARNING: 'VERSION.dll' should be excluded because its source file 'C:\Windows\system32\VERSION.dll' is under Windows System File Protection.
WARNING: 'VERSION.dll' should be excluded because its source file 'C:\Windows\system32\VERSION.dll' is under Windows System File Protection.
WARNING: 'NETAPI32.dll' should be excluded because its source file 'C:\Windows\system32\NETAPI32.dll' is under Windows System File Protection.
WARNING: 'NETAPI32.dll' should be excluded because its source file 'C:\Windows\system32\NETAPI32.dll' is under Windows System File Protection.
I noticed that all these files are placed in the "Detected Dependencies" folder in solution explorer:
At first I thought that I can select them all and delete them (or Exclude). Which I did. But then when I restarted the Visual Studio solution they re-appear in that list again and I get the same errors.
How do I remove them for good?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

