Marco Carolo
Marco Carolo

Reputation: 1

Generate resource dll from .resx for .NET Core 3.1 applications

It's my first post here, so I hope I do anything right.

I'm working for a company that is developing a .NET Core application inside Windows, using c# and VS 2019. The version I'm using of .NET Core is 3.1. Visual studio is updated to the latest version (14.5).

We've already written all the UI, and we were wondering if there is any way to generate, from a resx file, the associated localization DLL.

This could be useful, for the translator along Europe to localize the application and test the result inside the application.

I was searching for a way to do that (generate dll from resx) for several days, without being able to correctly find a way to successfully generate this dll from the resx file generated by VS. Whats I've tried so far:

  1. Using Resgen and al.exe with several parameters and a combination of them. I got the result that the dll was generated but not loaded from the application
  2. Using csc.exe with the input the resx file to be translated. I got as result a dll that was not loaded from the application
  3. Try different version of dotnet SDK, calling "dotnet csc.dll" from the SDK folders, without being able to generate a valid dll loaded from the application

My question now is, is there any way to generate not from inside VS a temporary dll that can be loaded from translator machine to test the application or, the only way is to have the resx file from him and then generate from developer machine the dll and give back to the translator in order to be properly tested? If not, is there a way to generate the resx built dll from VS Community without having all the source code (as you can imagine, we don't want to redistribute our source)? Any other ideas on how we can solve this problem?

Another idea that came up to our mind is to create a separate resource project, and distribute that to our translator. I think I'll try this path during the afternoon if no other useful ideas come up from here.

Thanks in advance for any reply to this post.

Upvotes: 0

Views: 3447

Answers (1)

Jaska
Jaska

Reputation: 1037

You can use two methods

1) RegGen + Assembly Linker

Use ResGen.exe to compile the localized .resx files into .resources Then use AL.exe to link the satellite assembly file

or

2) Use Visual Studio.

Just add the localized .resx file into your csproj file. Next time you build, Visual Studio also builds the satellite assemblies.

Before you can create the satellites you need to have the localized .resx files. Use a localization tool to create them. For example Soluling.

Upvotes: 1

Related Questions