Translations missing with ClickOnce

Feb 16, 2012 at 8:50 PM
Edited Feb 16, 2012 at 8:51 PM

Hello,

I'm trying to use your Add-In with a WPF ClickOnce application. The globalization works fine and all the resources are generated as expected, but when I publish my application only the en-US (default) .dll gets packaged and I can't see the other languages in Project properties -> Publish -> Application Files.

I also tried compiling the changeset 8807, without <UICulture> and without [assembly: NeutralResourcesLanguage...]. The results are that the en-US files are not there anymore (expected) but my translations are still absent.

Any idea of why this is happening?

I'm using Visual Studio 2010 Pro SP1

Thanks

Coordinator
Feb 17, 2012 at 8:18 AM

I think ClickOnce manifest is not generating correctly.

Perhaps I should modify .target file to include generated assemblies in some special list.

As a workaround for now, you can try to add Resources.resx for every language in your projects. In this way sattelite assemblies will be added to ClickOnce manifest by standard compiler, not by EasyBAML targets.

Coordinator
Feb 17, 2012 at 9:55 AM
Edited Feb 17, 2012 at 9:57 AM

I'll try fix this issue, but not sure when. Please share your solution if found :)

Perhaps this post can help you.

Perticularly, these lines in target file:

<!-- Add the new satellite DLLs to the list, so they are added to the manifest.-->
<ItemGroup>
<IntermediateSatelliteAssembliesWithTargetPath Include=
	"$(IntermediateOutputPath)%(LocBamlCsv.Culture)\$(TargetName).resources.dll">
<Culture>%(LocBamlCsv.Culture)</Culture>
<TargetPath>%(LocBamlCsv.Culture)\$(TargetName).resources.dll</TargetPath>
</IntermediateSatelliteAssembliesWithTargetPath>
</ItemGroup>
Feb 17, 2012 at 12:05 PM
Edited Feb 17, 2012 at 1:04 PM

You already have some very similar lines in EasyLocBaml.targets

    <!-- Add the new sattelite dll's to the list, so they are added to the manifest.-->
    <ItemGroup>
      <_SatelliteAssemblyResourceInputs Include="$(IntermediateOutputPath)$(AssemblyName).g.%(LocBamlResxC.Culture).resources">
        <Culture>%(LocBamlResxC.Culture)</Culture>
      </_SatelliteAssemblyResourceInputs>

      <_SatelliteResourceFile Include="$(IntermediateOutputPath)$(AssemblyName).g.%(LocBamlResxC.Culture).resources"/>

      <FileWrites Include="$(IntermediateOutputPath)$(AssemblyName).g.%(LocBamlResxC.Culture).resources"/>

     
      <IntermediateSatelliteAssembliesWithTargetPath Include="$(IntermediateOutputPath)%(LocBamlResxC.Culture)\$(TargetName).resources.dll">
        <Culture>%(LocBamlResxC.Culture)</Culture>
        <TargetPath>%(LocBamlResxC.Culture)\$(TargetName).resources.dll</TargetPath>
      </IntermediateSatelliteAssembliesWithTargetPath>
    </ItemGroup>
  </Target>

Even with the same comment! ;) Wouldn't that do the same?

Thanks for the quick reply !

Coordinator
Feb 17, 2012 at 12:21 PM

Yes, but, as you pointed, this appeared not to work.

Thus, either ClickOnce manifest generation doesn't use InetrmediateSatteliteAssembliesWithTargetPath ItemGroup, or this ItemGroup is not filled correctly, may be in some cases.

BTW, if you do "Rebuild solution", you get same manifest? Because, I recieved reports that resource files are not generated sometimes, during incremental build.

Feb 17, 2012 at 1:04 PM

Well when I try to run my published .application it looks for the translated file.

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of D:\Tests\EasyBamlClickOnceTest\EasyBamlClickOnceTest\publish\EasyBamlClickOnceTest.application resulted in exception. Following failure messages were detected:
        + Downloading file:///D:/Tests/EasyBamlClickOnceTest/EasyBamlClickOnceTest/publish/Application Files/EasyBamlClickOnceTest_1_0_0_9/fr/EasyBamlClickOnceTest.resources.dll.deploy did not succeed.

/fr/EasyBamlClickOnceTest.resources.dll.deploy exists in my regular /bin/debug output directory, but it's not in the publish folder nor is it in the application files list in Project Properties -> Publish -> Application Files. But the published application is looking for it during installation so somewhere there was a manifest that was updated right.

I just opened my ClickOnce manifest with MageUI and /fr/EasyBamlClickOnceTest.resources.dll.deploy is in the file list (with a warning sign, because he can't find it). So ClickOnce knows it should be there, but somehow VisualStudio doesn't when publishing.

When I build with Diagnostic verbosity, I see these lines

_DeploymentManifestDependencies
    obj\x86\Debug\fr\EasyBamlClickOnceTest.resources.dll
 Culture = fr TargetPath = fr\EasyBamlClickOnceTest.resources.dll AssemblyType = Satellite OriginalItemSpec = obj\x86\Debug\fr\EasyBamlClickOnceTest.resources.dll DependencyType = Install

So the manifest really seems fine.

But later on there is
Target "GenerateSatelliteAssemblies: (TargetId:86)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets" from project "D:\Tests\EasyBamlClickOnceTest\EasyBamlClickOnceTest\EasyBamlClickOnceTest.csproj" (target "CreateSatelliteAssemblies" depends on it):
Building target "GenerateSatelliteAssemblies" completely.
Output file "obj\x86\Debug\fr\EasyBamlClickOnceTest.resources.dll" does not exist.
So there might be some conflicting clean-up in-between...
Coordinator
Feb 20, 2012 at 5:41 AM

I'm not fully explored the topic, but article Localizing ClickOnce Applications says you need to do some manual steps in MageUI to include all satellite assemblies in your deployment.

Please write, if it helps or something need to be fixed in Easy BAML.

Best regards,

Konstantin

Feb 20, 2012 at 11:54 AM

I publish with visual studio and the article mentions "This method is the default in Visual Studio. To use this method in Visual Studio, you do not have to do any additional work.". I did the manual steps anyway and I can see that the files are already in the manifest. The problem is that Visual Studio doesn't pick the files up when publishing. I'll let you know if I find a solution to the problem.

Feb 21, 2012 at 12:39 PM

It seems that only adding a dummy Resources.fr.resx in my Properties solves the problem. Even if my dummy has content in it, it seems that both EasyBaml's Translate.fr.resx and my Resources.fr.resx are merged and all the translations are kept. on publish. So it's an easy fix after all ! heh Thanks for your help.

Coordinator
Feb 24, 2012 at 8:15 PM

Thank you for information.

I added an issue http://easybaml.codeplex.com/workitem/1023 , going to investigate it some day.