我在dll中有一些资源文件(.resx)。
这个dll是从我的网站引用的,编译在我的'UserControlResource.de.resx'中的\ bin \ language文件夹中创建一个'admin.UserControlResource.dll'dll
现在我有一些新的资源文件(.resx文本文件),我想在项目之外将它们编译成新的dll,所以我可以将这些dll复制到我的生产服务器。
我尝试过resgen.exe,但这不允许我为生成的文件指定.dll扩展名。
我尝试了另一个扩展并将其重命名为.dll,但这不起作用。
这是我试过的:
resgen UserControlResource.de.resx
al.exe /t:lib /culture:de /embed:"UserControlResource.de.resources" /out:"Dwight.UserControl.resources.dll"
我见过(在例子中)al.exe是否使用/ t:lib执行,但两者都不起作用。
“不工作”是什么意思?
resgen创建.resources文件
al.exe创建一个dll并且不显示任何警告
但是当我将dll复制到服务器时,会使用默认的英语资源,而不是德语(de)。
答案 0 :(得分:2)
听起来您想创建附属程序集并部署这些附属程序集。这是一个很好的解释过程以及您需要在MSDN上考虑的内容: http://msdn.microsoft.com/en-us/library/sb6a8618%28v=vs.80%29.aspx
希望有所帮助:)
答案 1 :(得分:0)
我找到了一系列对我有用的resgen.exe和al.exe命令:
Resgen.exe:
"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\ResGen.exe" Strings.resx
输出:
Read in 10 resources from "Strings.resx"
Writing resource file... Done.
Al.exe工具:
"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\al.exe" /t:lib /embed:Strings.resources /culture:en /out:Strings.dll
输出:
Microsoft (R) Assembly Linker Version 12.0.20806.33440
Copyright (C) Microsoft Corporation. All rights reserved.
这是一个dll,可以在不使用Visual Studio的情况下包含在已发布的版本中。