资源文件在编译时未正确嵌入或链接到程序集中... [英] Resources file not getting correctly embedded or linked into assembly at compile time...

查看:302
本文介绍了资源文件在编译时未正确嵌入或链接到程序集中...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



在VC ++。net 2010项目中,我导入了几个获胜形式(即.h,.cpp .resx文件)。构建项目后,会创建相应的.resources文件。



根据2010年的默认设置,创建名称格式为NamespaceName.ClassName.resources的.resources文件。



因为,在项目中,我放置了.h&某些目录中的.cpp文件。由于这个.resource文件的名称格式为NamespaceName.Dir1.Dir2.ClassName.resources。



此名称格式不一致导致设计时错误。

错误: - 无法找到适合指定文化或中性文化的任何资源。确保在编译时将NamespaceName.ClassName.resources正确嵌入或链接到程序集ProjectName中,或者确保所需的所有附属程序集都是可加载和完全签名的。



我尝试更改托管资源设置以匹配格式NamespaceName.ClassName.resources。



有什么办法可以更改设置来创建具有正确命名格式的.resources文件?



谢谢

Kedar

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

推荐答案

You can set the logical name in the .vcxproj project file by adding LogicalName to the EmbeddedResource, like


        <EmbeddedResource Include="Dir1/Dir2/ClassName.resx">
          ....
          <LogicalName>NamespaceName.ClassName.resources</LogicalName>
        </EmbeddedResource>


这篇关于资源文件在编译时未正确嵌入或链接到程序集中...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆