Skip to main content
All docs
V24.1
.NET 6.0+

XAF0006: Invalid target platform. Change the target platform to "Any CPU" in the project or solution properties

Severity: Warning

The Model Editor for .NET projects requires that the project target platform is Any CPU. If the project platform is not Any CPU, you cannot invoke the Model Editor for this project.

How to Fix

Use one of the following techniques to fix this warning:

In the Project Properties

  1. Right-click the project in the Solution Explorer and select “Properties”.

  2. Navigate to the Build tab and set the Platform target property to “Any CPU”.

In the Solution Properties

  1. In Visual Studio, click the Build | Configuration Manager… menu item.
  2. Set the project’s platform to “Any CPU”.

How to Suppress this Warning

Refer to the following Microsoft article to learn how to suppress warning messages for a specific project: How to: Suppress compiler warnings.

To suppress warning messages for all projects in a solution, follow the steps below:

  1. Open the “Directory.Build.props” file or create it in the root directory of your solution. For more information, refer to the following article: Customize your build: Directory.Build.props and Directory.Build.targets.
  2. In the NoWarn section, specify codes of warnings that you want to suppress. Use semicolons to separate codes:

    <Project>
      <PropertyGroup>
        <NoWarn>XAF0006;XAF0007</NoWarn>
      </PropertyGroup>
    </Project>