Base solution for your next web application
Open Closed

Error after add xml loaclization file #11364


0
Adrian created

Hello. I created a new xml file with the Polish language by copying the default .xml file. Unfortunately I am getting a compilation error. Can I ask for help?

private static List<ApplicationLanguage> GetInitialLanguages()
        {
            var tenantId = NavimanConsts.MultiTenancyEnabled ? null : (int?)1;
            return new List<ApplicationLanguage>
            {
                new ApplicationLanguage(tenantId, "en", "English", "famfamfam-flags us"),
                new ApplicationLanguage(tenantId, "en-GB", "English (UK)", "famfamfam-flags gb"),
                new ApplicationLanguage(tenantId, "pl", "Poland", "famfamfam-flags pl"),
                new ApplicationLanguage(tenantId, "ar", "العربية", "famfamfam-flags sa"),
                new ApplicationLanguage(tenantId, "de", "Deutsch", "famfamfam-flags de"),
                new ApplicationLanguage(tenantId, "it", "Italiano", "famfamfam-flags it"),
                new ApplicationLanguage(tenantId, "fr", "Français", "famfamfam-flags fr"),
                new ApplicationLanguage(tenantId, "pt-BR", "Português (Brasil)", "famfamfam-flags br"),
                new ApplicationLanguage(tenantId, "tr", "Türkçe", "famfamfam-flags tr"),
                new ApplicationLanguage(tenantId, "ru", "Pусский", "famfamfam-flags ru"),
                new ApplicationLanguage(tenantId, "zh-Hans", "简体中文", "famfamfam-flags cn"),
                new ApplicationLanguage(tenantId, "es-MX", "Español (México)", "famfamfam-flags mx"),
                new ApplicationLanguage(tenantId, "es", "Español (Spanish)", "famfamfam-flags es"),
                new ApplicationLanguage(tenantId, "vi", "Tiếng Việt", "famfamfam-flags vn"),
                new ApplicationLanguage(tenantId, "nl", "Dutch (Nederlands)", "famfamfam-flags nl"),
                new ApplicationLanguage(tenantId, "th", "ภาษาไทย", "famfamfam-flags th"),
            };
        }

I got an error about duplicate emedeed resource file Naviman-pl.xml Ważność Kod Opis Projekt Plik Wiersz Stan pominięcia

Błąd NETSDK1022 Zostały uwzględnione zduplikowane elementy „EmbeddedResource”. Zestaw .NET SDK dołącza domyślnie elementy „EmbeddedResource” z katalogu projektu. Możesz usunąć te elementy z pliku projektu lub ustawić dla właściwości „EnableDefaultEmbeddedResourceItems” wartość „false”, aby jawnie uwzględnić je w pliku projektu.Aby uzyskać więcej informacji, zobacz https://aka.ms/sdkimplicititems. Zduplikowane elementy: 'Localization\Naviman\Naviman-pl.xml' Naviman.Core C:\Program Files\dotnet\sdk\6.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.Shared.targets 201


1 Answer(s)
  • 0
    ismcagdas created
    Support Team

    Hi @Adrian

    As far as I can understand, Visual Studio complains about duplicate files. Could you delete the bin and obj folders (you can run Delete-BIN-OBJ-Folders.bat file) and build the solution again ?

    Thanks