我在运行Windows 7 Professional 64位的Visual Studio 2012中有一个C#项目(WinForms)。
我的WinForms应用程序带有两种语言-英语和德语。
因此,在我的Visual Studio项目中,我有两个资源文件(.resx)lang.resx(包含我的默认语言,德语)和lang.en-GB.resx(包含我的可选语言,英语)。
当我为.NET 3.5编译项目时,VS在我的应用程序项目文件夹中创建两个文件夹“ de_DE”和“ en_GB”,并将包含语言内容的DLL文件复制到这两个文件夹中(两个文件都名为“ app.resources”。 dll”)。
到目前为止,一切都很好。当我不感到困惑时,我的应用程序运行良好。在Windows的英语副本上运行时,它显示英语文本,在Windows的德语或任何其他语言副本上运行时,它显示德语文本。
现在,我使用Confusor版本1.9(最新的,预编译的,可下载的.exe版本)将代码与Confuser(可在CodePlex:https://confuser.codeplex.com/上找到)混淆。
当我将“ app.exe”,“ de-DE \ app.resources.dll”和“ en-GB \ app.resources.dll”添加到confuser时,混淆者只会生成1个混淆的app.resources.dll-不会2(每种语言/资源DLL一个)。
这意味着,我无法在语言之间进行切换,因为似乎只有一个app.resources.dll被配置者(而不是两者)考虑。
我猜我的项目设置没有什么特别的或突出的(使用多种语言的纯老式WinForm应用程序)。
我的问题是:
我必须如何配置confuser,以使其正确混淆我的app.exe和两个app.resources.dll文件?
任何帮助(甚至提示)都将不胜感激!
最佳答案
在confuser补丁列表中,它可以解决您的确切问题:)
http://confuser.codeplex.com/sourcecontrol/list/patches
修补程序ID 14664与您的问题有关,看起来您需要在项目文件中设置条目(摘录自自己的站点):
An example with language files, showing what the output should be:
Executables\Common.resources.dll -> targetfolder\common.resources.dll
Executables\de\Common.resources.dll -> targetfolder\de\common.resources.dll
Executables\fi\Common.resources.dll -> targetfolder\fi\common.resources.dll
etc.
After patching this can now be achieved with the following kind of project file:
...
<assembly path="..\Executables\Common.resources.dll" />
<assembly path="..\Executables\de\Common.resources.dll" toSubFolder="de" />
<assembly path="..\Executables\fi\Common.resources.dll" toSubFolder="fi" />