dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.2k stars 1.75k forks source link

[Bug] MAUI - iOS/Mac Localized Resx - multiple publish output files with the same relative path #1855

Closed derlateinprofi closed 2 years ago

derlateinprofi commented 3 years ago

Description

When using localized resx files for MAUI app the error " NETSDK1152
Found multiple publish output files with the same relative path: obj\Debug\net6.0-ios\iossimulator-x64\de\GreetingMuffin.Maui.resources.dll, obj\Debug\net6.0-ios\iossimulator-x64\en\GreetingMuffin.Maui.resources.dll. C:\Program Files\dotnet\sdk\6.0.100-preview.6.21355.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets
" occurs. This error seems only be related to iOS & macOS.

Steps to Reproduce

  1. Add a resource file -> e.g. UIResources.resx
  2. Add a second resource file with localized name -> e.g. UIResources.en.resx
  3. Add a second resource file with different localized name -> e.g. UIResources.de.resx

Expected Behavior

Applications compiles without error

Actual Behavior

Compilation breaks due to "duplicates" for isossimulator and maccatalyst

Basic Information

Screenshots

image

image

image

image

image

Workaround

Set <ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>

as mentioned here

https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#erroronduplicatepublishoutputfiles

Best, Chris

hartez commented 2 years ago

2300 has a repro project.

shimingsg commented 2 years ago

Not reproducible with 32214.398.main using iOS 15.2, after add UIResources.resx, UIResources.en.resx and UIResources.de.resx, Applications compiles without error. @derlateinprofi Is that what you wanted? image

ghost commented 2 years ago

Hi @derlateinprofi. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost commented 2 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.