MSB3249 diagnostic code
This article describes the MSB3249 error code.
Message text
MSB3249: Application Configuration file 'value' is invalid.
Remarks
The error MSB3249 is raised by the ResolveAssemblyReference
task in MSBuild when an invalid or malformed application configuration file (for example, app.config
) is detected during the build process. This usually occurs when the configuration file contains syntax errors, invalid XML, or unexpected values that prevent MSBuild from properly resolving assembly references. See ResolveAssemblyReference task.
Possible causes
- Malformed or invalid XML: The
app.config
file contains syntax errors or is not well-formed XML. - Missing or incorrect
<runtime>
section: Theapp.config
file is missing the<runtime>
element or contains invalid data in this section. See<runtime>
element. - Unrecognized configuration settings: The file includes settings that are not supported or are incorrectly specified.
- File not accessible: The
app.config
file is missing, locked, or inaccessible due to file permissions.
Resolution
Validate the
app.config
file:- Open the file in an XML editor or IDE that supports XML validation.
- Correct any syntax errors or invalid XML structure.
Check for unsupported or invalid settings:
- Review the file for any unrecognized configuration keys or invalid values.
- Refer to the Configuring apps by using configuration files for supported settings.
Ensure file accessibility:
- Confirm that the
app.config
file exists in the expected location. - Ensure the build process has the necessary permissions to read the file.
- Confirm that the
The ResolveAssemblyReference
task is responsible for resolving references to assemblies during the build process. An invalid app.config
file can prevent this task from completing successfully. For more information on the ResolveAssemblyReference
task, see MSBuild ResolveAssemblyReference Task.
Related content
Applies to
All versions of MSBuild