Build fails with “Couldn't process file *.resx due to its being in the Internet or Restricted zone or having the mark of the web on the file.”

Troubleshooting

Summary

Compiling ResX files fails with MSB3821 error about Internet or Restricted zone.

This article was written for an older version. It is only online as a reference for customers using this old version. The information it contains is probably out of date.

The latest information can be found in the yFiles documentation

Description

The following error message appears for one or more .resx resource files in a yFiles demo project:

MSB3821: Couldn't process file [file] 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.

Cause

The underlying cause is that the respective resource file has the so-called mark of the web applied to it. This is a marker that browsers place on downloaded files so that other applications can make informed decisions on whether to trust that file or not. It is also propagated to files extracted from archives, depending on the application the archive has been extracted with (e.g. Windows Explorer). The .NET Framework resource compiler honors this marker and refuses to compile those resource files for security reasons.

This is also explained in the Microsoft documentation about this error code.

Solution

Starting with yFiles.NET 5.4 this should be handled automatically when building the respective demo application. The project file includes a build target that will attempt to unblock all relevant files prior to compilation. This step may fail in very rare cases, though.

You can also unblock the files manually:

  • Open the properties of the ZIP archive you downloaded
  • Check the Unblock checkbox next to the message “This file came from another computer and might be blocked to help protect this computer”:

  • Re-extract the contents of the ZIP archive again and overwrite the existing files

Alternatively you can just unblock the yFiles assemblies in the lib directory as described above. All other files in the distribution should be unaffected by having such a marker.

See also

  • KB736: A similar issue with the .NET Framework License Compiler, which prevents a successful build if the yFiles assemblies have a mark of the web.

Resources

Categories this article belongs to:
yFiles WPF > Other
yFiles.NET > Other
Applies to:
yFiles.NET: 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6
Keywords:
resource compiler - resource - resources - resgen - mark of the web - build - internet zone - restricted zone - couldn't process file