Publish error: Found multiple publish output files with the same relative path

Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

Publish error: Found multiple publish output files with the same relative path

Message par Clippy »

Publish error: Found multiple publish output files with the same relative path
Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

Re: Publish error: Found multiple publish output files with the same relative path

Message par Clippy »

Issue:

The issue raises after .NET 6 migration.
There's a new feature that blocks multiple files from being copied to the same target directory with the same file name.
See [https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/6.0/duplicate-files-in-output](https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/6.0/duplicate-files-in-output)

Solution #1 (workaround):

You can add the following build property to all your publishable (*.Web) projects' *.csproj files.
This property will bypass this check and works as previously, in .NET5.

```

false


```

Solution #2:

Exclude the problematic files to be copied to the output folder.
In this example we'll exclude these files: `compilerconfig.json` and `package.json`.

Add the following lines to your `common.props` (located in the root directory of your solution):

```


true
Never


```
Répondre

Revenir à « Azure Infrastructure »