none
Issue with localized resources when a C++/CLI project references (depends on) another one in the same solution. RRS feed

  • Question

  • Updated by original author:

    Well, I set the output mode to "diagnostic" and I found this when building project B (that references to project A):

    1>          E:\Win32\Release\fr\\B.resources.dll
    1>                  BuildReference=true
    1>                  Configuration=Release
    1>                  CopyLocal=true
    1>                  CopyLocalSatelliteAssemblies=true
    1>                  Culture=fr\
    1>                  DestinationSubDirectory=fr\
    1>                  FullConfiguration=Release|Win32
    1>                  FusionName=
    1>                  LinkLibraryDependencies=true
    1>                  MSBuildSourceProjectFile=E:\MySolution\A\A.vcxproj
    1>                  MSBuildSourceTargetName=GetTargetPath
    1>                  OriginalItemSpec=E:\MySolution\Win32\Release\A.dll
    1>                  OriginalProjectReferenceItemSpec=..\A\A.vcxproj
    1>                  OutputItemType=_ResolvedNativeProjectReferencePaths
    1>                  Platform=Win32
    1>                  Private=true
    1>                  Project={c9079dad-ba64-49eb-bb2e-6a2c91e8acc7}
    1>                  ReferenceOutputAssembly=true
    1>                  ReferenceSourceTarget=ProjectReference
    1>                  ResolvedFrom=E:\MySolution\Win32\Release\A.dll
    1>                  SetConfiguration=Configuration=Release
    1>                  SetPlatform=Platform=Win32
    1>                  TargetPath=fr\\B.resources.dll
    1>                  Targets=
    1>                  UseLibraryDependencyInputs=false
    1>                  Version=0.0.0.0 (TaskId:97)
    1>  Task Parameter:SkipUnchangedFiles=True (TaskId:97)
    1>  Task Parameter:OverwriteReadOnlyFiles=False (TaskId:97)
    1>  Task Parameter:UseHardlinksIfPossible=False (TaskId:97)
    1>  Copying file from "E:\MySolution\Win32\Release\fr\A.resources.dll" to "E:\MySolution\Win32\Release\fr\\B.resources.dll". (TaskId:97) 

    Note that this last line indicates that the file A.resources.dll is copied over the file B.resources.dll. This is my problem and this is what I observe.

    Note also that CopyLocal=true is logged but in my properties, CopyLocal is set to false.

    What is going bad?

    -----------------------------

    Hello all! 

    I don't know where my problem is exactly. So if you find I should post it in another forum, just tell me.

    Here is the description of my problem. I have a large (~300 projects) solution within VS2012. Projects are in C++ (both managed and unmanaged, my problem is with managed C++/cli projects).

    Assume I have a C++/cli project A that is localized with StringTable.resx and StringTable.fr.resx. I also have a project B that is localized the same way. Now, assume B depends on A. So I added a reference to A from within project B's properties. Note that I used the "solution" tab to select A.

    When I build A everything is fine. I get A.dll and fr\A.resources.dll and both are correct according to the report generated by ILSpy.exe. Their creation date is also correct.

    Now, the problem arrives when I build B. I get B.dll but in folder fr I find A.resources.dll and B.resources.dll. The exact problem is that B.resources.dll is a copy of A.resources.dll (still according to ILSpy.exe). Even the creation date proves it: B.resources.dll was created before any binaries in the B IntDir/OutDir folders!

    Note that the default localization (English in my case) is correct. Only the specially defined localization (French,etc.) are not.

    More info: this 2012 solution was imported and converted from a 2005 solution.

    Also: I remarked that reference settings Copy Local, Copy Local Satellite Assemblies, Reference Assembly Output, Link Library Dependencies and Use Library Dependency Inputs cannot be changed. They always reset to their original values. In my case, they are set to False, True, True, True and False respectively.

    Another point: If I create the reference to A using the "Browse" tab (like if A was a third party assembly) the problem is solved. But this implies that A.dll was previously build and cannot be used inside a solution.

    If you want more info I will be more than happy to give you what you need if you can help me to solve my issue.

    Thank you,

    Dominique


    Wednesday, January 9, 2013 12:58 PM

Answers

  • Hello!

    I found that the problem seems to come from CopyLocalSatelliteAssemblies: it should be set to false.

    I created a small solution from scratch and saw that when I reference A from B, CopyLocalSatelliteAssemblies and ReferenceOutputAssembly are set to False and True respectively but don't appear in the .vcxproj file.

    So I removed these nodes from my .vcxproj files and it seems that localization works now. I think the incorrect nodes appeared during conversion from VS2005 to VS2012. Is it possible?

    Dominique

    Friday, January 11, 2013 12:56 PM

All replies

  • Hi Dominique,

    I am moving your thread into the Common Language Runtime Internals and Architecture Forum for dedicated support. Thanks for your understanding.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, January 11, 2013 6:19 AM
  • Hi Dom,

    B must copy A.dll to B's folder, since it is refered to that reference.

    And the key point is the copy local property doesn't impact your application at all after you release them, it just something during the development.

    Just forget it.

    Have a nice day.


    Ghost,
    Call me ghost for short, Thanks
    To get the better answer, it should be a better question.

    Friday, January 11, 2013 7:35 AM
  • Hello!

    I found that the problem seems to come from CopyLocalSatelliteAssemblies: it should be set to false.

    I created a small solution from scratch and saw that when I reference A from B, CopyLocalSatelliteAssemblies and ReferenceOutputAssembly are set to False and True respectively but don't appear in the .vcxproj file.

    So I removed these nodes from my .vcxproj files and it seems that localization works now. I think the incorrect nodes appeared during conversion from VS2005 to VS2012. Is it possible?

    Dominique

    Friday, January 11, 2013 12:56 PM
  • Hi Dominique,

    Try another VS2005 project with your steps, and try to reproduce this issue, if success, report it here: http://connect.microsoft.com/VisualStudio 

    The dedicated team will focus on it.

    Thank you.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, January 14, 2013 4:59 AM
    Moderator