从视觉工作室外部编译我的 resx 文件

发布于 2024-11-26 13:22:55 字数 709 浏览 3 评论 0原文

我在 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)资源。

i have a few resource files (.resx) in a dll.

this dll is referenced from my website, and compiling creates a 'admin.UserControlResource.dll' dll in my \bin\language folder from my 'UserControlResource.de.resx'

now i have some new resource files (the .resx text file), and i want to compile them into new dll's, outside my project, so i will able to just copy those dll's to my production server.

i tried resgen.exe, but that won't allow me to specify the .dll extension for the generated file.

i tried another extension and rename it to .dll, but that didn't work.

this is what i tried:

resgen UserControlResource.de.resx
     al.exe /t:lib /culture:de /embed:"UserControlResource.de.resources" /out:"Dwight.UserControl.resources.dll"

i've seen (in examples) al.exe been executed with and without /t:lib, but both don't work.

what do i mean with 'dont work'?

resgen creates a .resources file

al.exe creates a dll and shows no warnings

but when i copy the dll to the server the default english resources are used, and not the german (de) ones.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

尽揽少女心 2024-12-03 13:22:55

听起来您想要创建附属程序集并部署这些附属程序集。 MSDN 上对该过程以及需要考虑的内容有很好的解释:
http://msdn.microsoft.com/en -us/library/sb6a8618%28v=vs.80%29.aspx

希望有帮助:)

Sounds like you want to create satellite assemblies and deploy those satellite assemblies. Theres a good explanation of the process and what you need to consider on MSDN:
http://msdn.microsoft.com/en-us/library/sb6a8618%28v=vs.80%29.aspx

Hope that helps :)

那片花海 2024-12-03 13:22:55

我发现了一系列对我有用的 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。

I found a sequence of resgen.exe and al.exe commands that worked for me:

Resgen.exe:

"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\ResGen.exe" Strings.resx

Output:

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

Output:

Microsoft (R) Assembly Linker Version 12.0.20806.33440
Copyright (C) Microsoft Corporation. All rights reserved.

The output of this is a dll that can be included into the released version without using Visual Studio.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文