我需要一些帮助为我的Windows Phone 7应用程序。Silverlight WP7资源DLL
我想在我的第一个项目中构建一个嵌入我所有字符串资源的.dll文件。
然后,在我的第二个项目中,我想构建HelloWorld应用程序,它可以使用我的.dll中的字符串。
要做到这一点我建立的.dll根据这个帖子:http://msdn.microsoft.com/en-us/library/21a15yht%28v=VS.100%29.aspx
所以我先编译.resx文件:
ResGen.exe /useSourcePath /compile strings.fr.rex,HelloWorld.strings.fr.resources
好吧,我的文件HelloWorld.strings.fr.resources是成功创建。
现在,我编译.resources文件到.dll文件:
al.exe /t:lib /embed:HellowWorld.strings.fr.resources /culture:fr /out:HelloWorld.resources.dll
好吧,我的文件HelloWorld.resources.dll成功创建。
现在,在我的第二个项目WP7 HelloWorld中,我右键单击“引用”并添加我的.dll。
Thenk在主网页我打电话资源经理是这样的:
System.Resources.ResourceManager rm = new System.Resources.ResourceManager("HelloWorld.resources", System.Reflection.Assembly.GetExecutingAssembly());
并尝试从DLL加载字符串:
PageTitle.Text = rm.GetString("mystring");
但在运行时,我得到异常:MissingManifestResourceException
你能帮忙解决吗?
此解决方案有帮助吗? http://stackoverflow.com/questions/1327692/c-what-does-missingmanifestresourceexception-mean-and-how-to-fix-it – keyboardP