0

I have been looking hours for a solution, but I don´t find it. I want to generate a satellite assembly with following command.

locbaml.exe /generate de/App.UI.resources.dll /trans:MeineRess_de.csv /out:de /cul:de

After executing I get following error:

The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

Can anybody help me, Thx

Parag
  • 543
  • 1
  • 8
  • 18
Dev Knight
  • 95
  • 1
  • 9
  • Well, make sure you close all Visual Studios and any other program that might be using the input or output files. – H H May 15 '17 at 08:28
  • i restartet the computer and was only executing the locbaml.exe Application. i got the same error – Dev Knight May 15 '17 at 09:30
  • That is strange. But the `/out:de /cul:de` part looks strange, maybe you're locking your own files. To diagnose, change it to `/out:de /cul:de2` after creating de2, and see what happens. – H H May 15 '17 at 10:31
  • Error Message -> Error: Culture is not supported. Parameter name: name de1 is an invalid culture identifier. – Dev Knight May 15 '17 at 11:07
  • Is there a better way to localize a wpf application. I am despairing – Dev Knight May 15 '17 at 11:08
  • Localization for WPF is a little 'rough', it looks unfinished. I just spotted an example that used `/cul:..\fr` so maybe it is a folder that has to comply with known cultures. – H H May 15 '17 at 11:18
  • The same error message like before -> The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020) – Dev Knight May 15 '17 at 12:07
  • You need some systematic elimination process now... I would recreate the folder structure and input files in another place (or a temp project). – H H May 15 '17 at 12:25

2 Answers2

0

Output to a separate folder try for example c:\ this would work

locbaml.exe /generate de/App.UI.resources.dll /trans:MeineRess_de.csv /out:c:\ /cul:de

sissy
  • 2,908
  • 2
  • 28
  • 54
Geniuslead
  • 99
  • 1
  • 5
0

For posterity: The file name without any command line flag is the original input assembly. So you're reading in de/App.UI.resources.dll and then /out:de is trying to write to the same file in the same folder. Probably you want to change de/App.UI.resources.dll to [UiCulture]/App.UI.resources.dll where [UiCulture] is the <UICulture> from your project file, which should match the NeutralResourcesLanguage attribute in your assembly (AssemblyInfo.cs normally).

Perhaps you legitimately want to overwrite the original DLL (though I don't think that makes sense), but this will not be possible as-is because locbaml will load the assembly from file, which holds the file handle open until the application exits. (Technically until the AppDomain is destroyed.)

IceGlasses
  • 282
  • 1
  • 4