Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article describes the MSB3821 error code.
Message text
MSB3821: Couldn't process file 'value' due to its being in the Internet or Restricted zone or having the mark of the web on the file. Remove the mark of the web if you want to process these files.
Description
This error occurs when MSBuild attempts to process a file downloaded from the web (or a cloud drive) that has security restrictions.
When you download web assets like HTML pages to a Windows device by using a browser, the browser inserts a marker called the mark of the web, which records the security zone of the site from which the page originated. The mark is intended to help protect from potentially malicious pages and enforce the security level on the original site, even after a page from the site is downloaded. This security check is required due to a specific security issue: Visual Studio remote code execution vulnerability CVE-2018-8172.
Resolution
If you decide to trust the content in question, you can override the restriction by unblocking a single file from File Explorer. Open the Properties window on the file, and select Unblock. You can also unblock multiple files with a PowerShell script and the Unblock-File cmdlet.
Visual Studio also includes security restrictions that detect the mark of the web comment. You can customize trust settings in the Tools > Options pane in the All Settings > Environment > Security > Trust section. For more information, see Configure trust settings for files and folders.
Visual Studio also includes security restrictions that detect the mark of the web comment. You can customize trust settings in the Tools > Options dialog in the Environment > Security section. For more information, see Configure trust settings for files and folders.
In some cases, you can't fix the error directly in Visual Studio. Instead, follow this procedure:
- Close Visual Studio.
- In File Explorer, go to the project folder.
- Locate the file that has the MSB3821 error and open the Properties menu (Alt + Enter).
- Select the Unblock checkbox, and then select Apply.
- Close the window.
- Restart Visual Studio. Open your project, and build the project again.
Applies to
All versions of MSBuild