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

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

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

Message par ForumBot »

Publish error: Found multiple publish output files with the same relative path
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

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

Message par ForumBot »

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 »