简体   繁体   中英

Is Multilingual App Toolkit compatible with multi target framework?

I'm trying to use MAT with a package I'm building (in C#). I can enable MAT when my package targets only one framework (for exemple .NET core 3.1)

<PropertyGroup>
  <TargetFramework>netcoreapp3.1</TargetFramework>
  <NeutralLanguage>fr</NeutralLanguage>
</PropertyGroup>

but if I choose to target multi framework, the option is disabled

<PropertyGroup>
  <TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
  <NeutralLanguage>fr</NeutralLanguage>
</PropertyGroup>

(note the 's' at the end of framework)

Did I miss something?

I did an experiment and I found that you have to have a single <TargetFramework> setting only:

  • to enable MAT for the project
  • to add new language

As soon as you have the language-specific .resx and .xlf files you can restore the multi-targeting by setting <TargetFrameworks> node.

I successfully

  • added new string resources and their translations
  • built/ran the solution

when multi-targeting was on.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM