Edit

Share via


MSB3941 diagnostic code

This article describes the MSB3941 error code.

Message text

MSB3941: Failed to zip directory 'value' because it does not exist or is inaccessible.

Description

This error occurs when your project uses the ZipDirectory task, which takes an input directory and produces a compressed ZIP file, but the input directory could not be found or accessed.

Resolution

You can use the -v:diag switch on the MSBuild command line to get more detailed information about the MSBuild execution, such as the values of the input parameters provided to the ZipDirectory task. In Visual Studio, in Tools, Options, Build and Run, set Verbosity to Diagnostic.

Check the spelling and syntax of the input parameters of the ZipDirectory task, which might be called from your project file (it is not called by the MSBuild, C++, or .NET SDK build system), a file that your project imports. Verify that the folder exists and allows read permissions. If your ZipDirectory task uses a property value or environment variable in its input, check that the property or environment variable has the expected value. If the property comes from a command line, check the command line for any syntax issues, mismatched quotes, or special shell characters.

Check that the directory allows Read permissions to the process that runs MSBuild.

Applies to

All versions of MSBuild