Background
Web projects under Visual Studio
Phenomenon
The unable to add ' xxx ' to the WEB site was encountered when publishing. Unable to add file ' xxx '. The specified file could not being encrypted. Error
Reason
- These files (folders) are set to "encrypt". This may be because these files are downloaded from the Internet and copied to the folder under the project, and the encryption option is enabled before the download
- These files (folders) are from other computers and are locked
Solutions
For reasons caused by cause 1:
In the File Manager, navigate to the destination file (folder), right-click Properties----Advanced, cancel encryption option, republish, error cancellation
For reasons caused by cause 2:
In the File Manager, navigate to the destination file (folder), right-click Properties, and tap the "unlock" button (if any). Republish, error relieved
If you are locked in a downloaded zip file, all of the files are locked by default. Windows does not inherently provide a shortcut to bulk unlock multiple files (after selecting multiple files, right-clicking on the Properties menu will reveal that the unlock button is missing). The simplest and fastest way is to unlock the zip file before extracting it, so the extracted files are all unlocked.
Visual Studio Publishing Web project error: Unable to add ' xxx ' to the Web site. Unable to add file ' xxx '. The specified file could not being encrypted.