none
Resources file not getting correctly embedded or linked into assembly at compile time...

    Question

  • Hello, In VC++.net 2010 project, I have imported few win forms (ie .h, .cpp. resx files). After building the project their corresponding .resources files are created. As per the default setting in 2010 .resources file is created with name format as “NamespaceName.ClassName.resources”. Since, in the project I have placed .h & .cpp files in some directories. Due to this .resource file is created with name format as “NamespaceName.Dir1.Dir2.ClassName.resources”. This name format inconsistency cause’s design time error. Error: -“Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "NamespaceName.ClassName.resources" was correctly embedded or linked into assembly "ProjectName" at compile time, or that all the satellite assemblies required are loadable and fully signed”. I have tried changing the Managed Resource settings to match format “NamespaceName.ClassName.resources”. Is there any way that I can change the setting to create .resources file with proper naming format? Thanks Kedar
    • Changed type Kedar Kumbhar Thursday, May 05, 2011 4:56 AM Issue is of different language
    • Moved by Liliane Teng Friday, May 06, 2011 6:56 AM (From:Visual Basic IDE)
    Wednesday, May 04, 2011 5:02 AM

All replies

  • This looks like a VC++ issue and possibly best asked in the VC++ forums

    http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/threads

     

     

    Wednesday, May 04, 2011 11:50 PM
  • <!-- @page { margin: 0.79in } P { margin-bottom: 0.08in } -->

    Hello,

     

    In VC++.net 2010 project, I have imported few win forms (ie .h, .cpp. resx files). After building the project their corresponding .resources files are created.

     

    As per the default setting in 2010 .resources file is created with name format as “NamespaceName.ClassName.resources”.

     

    Since, in the project I have placed .h & .cpp files in some directories. Due to this .resource file is created with name format as “NamespaceName.Dir1.Dir2.ClassName.resources”.

     

    This name format inconsistency cause’s design time error.

    Error: -“Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "NamespaceName.ClassName.resources" was correctly embedded or linked into assembly "ProjectName" at compile time, or that all the satellite assemblies required are loadable and fully signed”.

     

    I have tried changing the Managed Resource settings to match format “NamespaceName.ClassName.resources”.

     

    Is there any way that I can change the setting to create .resources file with proper naming format?

     

    Thanks

    Kedar

    • Merged by Rob Pan Wednesday, May 18, 2011 8:37 AM the same thread
    Thursday, May 05, 2011 5:28 AM
  • Hi Kedar,

     

    Welcome to the MSDN forum.

     

    Did you use CLI/C++, if so I think you need to change "." in NamespaceName.ClassName.resources  to :: like this NamespaceName::ClassName::resources

     

    I hope my suggestions can help you to solve this problem.

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, May 06, 2011 9:33 AM
    Moderator
  • Hi Kedar,

    Thank you for the post.

    Have you resolved your problem?

    You can refer to the following link:

    http://msdn.microsoft.com/en-us/library/xbx3z216.aspx

    I hope it’s helpful for you.

    Best regards,

    Avalanc

    Monday, May 09, 2011 5:49 AM
  • Hi Jesse, I tried with the solution you suggested. I changed Managed Resources property to "$(IntDir)\$(RootNamespace)::$(InputName)::resources". Replacing "." with "::". But, on build it gives an error "error LNK1316: duplicate managed resource name 'Debug\\WorkSpaceBuilder::::resources'". Even I tried to changing Managed Resources property of .resx file of each win-form. Still it creates .resources file with format "NamespaceName.Dir1.Dir2.ClassName.resources.". Is there a Macro which returns name of only Class instead of whole file path? Note: - In my explorer formatting is not working so you may get my text in unformed format. Sorry for that. Thanks Kedar
    Wednesday, May 11, 2011 5:43 AM
  • According to http://connect.microsoft.com/VisualStudio/feedback/details/534099/link-error-lnk1316-duplicate-managed-resource, after you add existing .h, .cpp and .resx files that are located in a subfolder, you should change the type of .h file to “C++ Form”. Then you have to close the solution and open the project file in a text editor. Then find the definition of added .resx file and make two manual adjustments: remove duplicate <EmbeddedResource> element and change the path in <DependentUpon> element. For example if the form is “Form2” and the folder is “Folder2”, the definitions will be:

     

    <ItemGroup>

        <EmbeddedResource Include="Folder2\Form2.resx">

            <DependentUpon>Folder2\Form2.h</DependentUpon>

        </EmbeddedResource>

        . . . .

     

    Try these steps with a new experimental project.

     

    Wednesday, May 11, 2011 6:19 AM
  • Hi Viorel,

    I followed the above mentioned steps. I check for .h file type (cppform) and duplicate EmbededResource entries. It was already as required so no change done. Only missing was full path in <DependentUpon> that I have changed. Now project is in proper structure. Forms and .resx file are in proper hierarchy.

    But, the problem I am facing is: -

    When I run the project it throws an exception - "Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "WorkspaceBuilder.MapBase.resources" was correctly embedded or linked into assembly "WorkSpaceBuilder" at compile time, or that all the satellite assemblies required are loadable and fully signed."

    The compiler is expecting .resources file with name "WorkspaceBuilder.MapBase.resources". But, IDE is creating this file as "WorkSpaceBuilder.ConversionWkSBuilder.WksBuilder.MapBase.resources". This name includes NamespaceName + FolderName + ClassName.resources.

    Because of this mismatch it throws an exception.

    I tried changing Project Properties --> Managed Resources -->Resource Logical Name to "$(IntDir)\$(RootNamespace).$(InputName).resources" format (even replaced '.' operator with '::' operator).

    Even, I tried changing Managed Resource Property of each .resx file to "$(IntDir)WorkspaceBuilder.MapBase.resources" format.

    But, no success. Still receiving that exception.

    This method worked fine with VS.Net 2008. Here in 2010 it is showing this as an issue.

    Is there difference in Macros values which are different in 2008 & 2010.

    Is there solution to the above problem.

    Please help.

    Thanks

    Kedar


    Monday, May 16, 2011 10:52 AM
  • Hi Kedar,

    According to your description, it seems that you have post two similar thread to the forum. So I will merge them for better support. Thanks for your understanding.

     

    Best Regards,

    Rob


    Rob Pan [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 18, 2011 8:36 AM
  • Hi,

    Was this ever resolved? I'm facing the same problem with VS2010.

    Thanks


    Thursday, August 16, 2012 10:26 AM