Search code examples
wixwix3.5wix3wix3.7

Error The localization variable !(loc.EMRDataServiceDescription) is unknown. Please ensure the variable is defined


When i am building my WIX project from visual studio (Votive) I am getting the below error:

Severity Code Description Project Path File Line Column Source Suppression State Error The localization variable !(loc.EMRDataServiceDescription) is unknown. Please ensure the variable is defined. EMR4.0.1 E:\Code\EMR\EMR4\EMR4.0.1\EMR4.0.1 E:\Code\EMR\EMR4\EMR4.0.1\EMR4.0.1\EMR_WiX_Installer_EN.wxs 76 1 Build

I am using "EMRDataServiceDescription" in the below code snippet at the "ServiceInstall" element.

EMR_WiX_Installer_EN.wxs file

  <Component Id="DataServiceExeComponent" Guid="{6F0AFA7E-77EA-11E0-A3DF-5DD64824019B}" >
              <Condition><![CDATA[REINSTALLMODE<>"ecmus"]]></Condition>
              <File Id="EXECUTABLE2" Name="dataserv.exe" Source="$(var.DataServiceFile)" DiskId="1" KeyPath="yes" DefaultSize="7121522" DefaultVersion="4.3.0.0.1170.S" />
              **<ServiceInstall Id="InstallEMRDataService" Name="EMR Data Service" DisplayName="EMR Data Service"  Type="ownProcess" Start="auto" ErrorControl="normal" Description="!(loc.EMRataServiceDescription)">**

                <ServiceDependency Id="EMR UPS Service"/>

              </ServiceInstall>

And this is declared in WixUI_en-us.wxl file like as shown below:

 <String Id="EMRDataServiceDescription" Overridable="yes">Service for managing data operations.</String>

And the namespace is like as shown below:

<WixLocalization Culture="en-us" xmlns="http://wixtoolset.org/schemas/v4/wxl" Codepage="1252">

Before this error i got the below error that i fixed by using the setting in "Build Action".

Error The localization identifier 'EMRDataServiceDescription' has been duplicated in multiple locations. Please resolve the conflict. EMR4.0.1 light.exe 0 1 Build

Below are the settings i made:

Right click on the .wxl file Click on properties. Under “Build Action”: Changed “EmbeddedResource” to “None”

Did I miss anything or the error is due to the the settings i made?


Solution

  • Problem Scenario: A bit unclear what exactly is happening, but I think you must:

    • 1) either have a localization file for another language than English which is lacking the identifier you refer to: "APCDataServiceDescription" and you haven't excluded it from the build, or
    • 2) you have set the English localization file to "None" for "Build Action".

    Possible Resolution: First set the English location file to "EmbeddedResource" for the "Build Action" if this is not already the current setting. Next you can select what cultures to build by right clicking your WiX project in the Solution Explorer Pane in Visual Studio, then you go Properties and to the "Build" tab. Now set the "Cultures to build" field to "en-US" in order to build only English (or set it to the culture value of your main WiX project file - could be any culture):

    Cultures to Build

    Now try to build and see if the English version compiles correctly.