简体   繁体   中英

When attempting to enable Multilingual app toolkit on a project, nothing happens

When I try to enable the Mulitlingual app toolkit on a C# project, I get an error such as the following and nothing more happens:

Project 'project name' was not enabled - the project's source culture could not be determined.

What's wrong?

Add a line like this to your assemblyinfo.cs file:

[assembly: NeutralResourcesLanguage("en")] 

The indicated language is the one that the application currently uses (ie usually hardcoded texts, before translation)

For a .Net Standard project, edit the csproj file to add:

<PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <NeutralLanguage>en-US</NeutralLanguage>
</PropertyGroup>

In Visual Studio 2017 => Projects=>Properties=>Package=>Assembly nutral language=>English(...)=>Save Then Select Project in Solution Explorer=>Tools=>Multilingual App Toolkit =>Enable Selection 在此处输入图片说明

Update: VS2019

VS2019 has a lot of changes in UI, so to find Assembly Neutral Language Option you can try below solution.

Right Click on Project => Got To Properties => Search button "Assembly Information" => Neutral Language => Select English => Save. And then rest of the process is same Select Project => Tools=> Multilingual App=> Enable Selection在此处输入图片说明

Another method:

  • Open project properties
  • Select Application
  • Click the ASSEMBLY INFOMATION button
  • At the bottom, select a NEUTRAL LANGUAGE

Also in the OUTPUT panel in the SHOW OUTPUT FROM: dropdown, select MULTILINGUAL APP TOOLKIT.

Make sure you have at least one resource file!

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