dotnet / dotnet/sdk

CopyToPublishDirectory does not work in .net9.

Open
#46,073 3 comments 0 reactions 0 assignees View on GitHub
Area-WebSDK untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

CopyToPublishDirectory does not work after changing from .net8 to .net9. So file conflict occurs.

21>C:\Program Files\dotnet\sdk\9.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(112,5): 오류 NETSDK1152: 상대 경로가 같은 여러 게시 출력 파일을 찾았습니다. P:\Projects\MyCompany\MyProduct\src\MyProduct.Api\aspnet-core\src\MyProduct.Api.Client.Windows\appsettings.json, P:\Projects\MyCompany\MyProduct\src\MyProduct.Api\aspnet-core\src\MyProduct.Api.Client.Web.Host\appsettings.json, P:\Projects\MyCompany\MyProduct\src\MyProduct.Api\aspnet-core\src\MyProduct.Api.Client.Windows\appsettings.Production.json, P:\Projects\MyCompany\MyProduct\src\MyProduct.Api\aspnet-core\src\MyProduct.Api.Client.Web.Host\appsettings.Production.json.

MyProduct.Api.Client.Web.Host
```

PreserveNewest
false
true


PreserveNewest
false
appsettings.json
true

```
MyProduct.Api.Client.Windows
```

PreserveNewest
true
Always


PreserveNewest
true
appsettings.json
Always

```
any temporary solution?

added --- The problem has been solved.
MyProduct.Api.Client.Web.Host:
Change None to Content in MyProduct.Api.Client.Web.Host
![Image](https://github.com/user-attachments/assets/c16eff6b-706d-492e-b584-5be058bf4b54)

MyProduct.Api.Client.Windows:
Remove None+Remove from MyProduct.Api.Client.Windows. I don't know why this is there. VisualStudio added it.
![Image](https://github.com/user-attachments/assets/67b7a6fc-bcf2-4934-9878-7809732bbf4c)

It is true that this is not a problem in .net8.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.