Compiler error
-
Hello All. I have this error in my application and I have no idea of what I'm doing wrong: 'ALINK: error AL1057: Executables cannot be localized, Culture should always be empty' MSDN says about this 'An assembly is being created with /target:exe but /culture was specified. Assemblies in the .exe cannot have information in the Culture field'. I can understand what this means. Anyone can explain to me ?? :confused: Thanks.
-
Hello All. I have this error in my application and I have no idea of what I'm doing wrong: 'ALINK: error AL1057: Executables cannot be localized, Culture should always be empty' MSDN says about this 'An assembly is being created with /target:exe but /culture was specified. Assemblies in the .exe cannot have information in the Culture field'. I can understand what this means. Anyone can explain to me ?? :confused: Thanks.
It means don't use the /culture switch! The main exes and dlls are always compiled into language neutral assemblies. You can control which language is neutral by using the
System.Globalization.NeutralResourcesLanguageAttribute
, an assembly-level attribute that you would typically put in your AssemblyInfo.cs file (although it can go anywhere, so long as it is appended with theassembly:
prefix, like[assembly:NeutralResourcesLanguage("en-US")]
. The /culture switch is used for satellite assemblies - assemblies that contain localized resources (in source form, these are ResX files). They contain no code. You can also create localized assemblies by using theAssemblyCultureAttribute
, but these projects may not contain any code - only .ResX files (which are compiled to .resource files). You can find out more in MSDN about satellite assemblies at http://msdn.microsoft.com/library/en-us/cpguide/html/cpconsatelliteassembliesside-by-sideexecution.asp[^] and localizing resources at http://msdn.microsoft.com/library/en-us/cpguide/html/cpcondesigningglobalapplications.asp[^].-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
It means don't use the /culture switch! The main exes and dlls are always compiled into language neutral assemblies. You can control which language is neutral by using the
System.Globalization.NeutralResourcesLanguageAttribute
, an assembly-level attribute that you would typically put in your AssemblyInfo.cs file (although it can go anywhere, so long as it is appended with theassembly:
prefix, like[assembly:NeutralResourcesLanguage("en-US")]
. The /culture switch is used for satellite assemblies - assemblies that contain localized resources (in source form, these are ResX files). They contain no code. You can also create localized assemblies by using theAssemblyCultureAttribute
, but these projects may not contain any code - only .ResX files (which are compiled to .resource files). You can find out more in MSDN about satellite assemblies at http://msdn.microsoft.com/library/en-us/cpguide/html/cpconsatelliteassembliesside-by-sideexecution.asp[^] and localizing resources at http://msdn.microsoft.com/library/en-us/cpguide/html/cpcondesigningglobalapplications.asp[^].-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
Thanks for your response, but I'm still lost. I don't know how to turn off the /culture switch. The only thing I know about culture is that in the project I have a form in spanish and I want to translate it into English, so I put the Localizable property to true and then I selected into the languaje property English. Then I translated the form into English and after that I get the error. Is this the cause of the error ? How can I turn off the /Culture swicth ? Thanks in advance. Bye.
-
Thanks for your response, but I'm still lost. I don't know how to turn off the /culture switch. The only thing I know about culture is that in the project I have a form in spanish and I want to translate it into English, so I put the Localizable property to true and then I selected into the languaje property English. Then I translated the form into English and after that I get the error. Is this the cause of the error ? How can I turn off the /Culture swicth ? Thanks in advance. Bye.
Did you read the links I gave you? They discuss localization in great length. First, if you are authoring the original forms in Spanish and it is in that locale that all your code is contained, then use the NeutralResourcesLanguageAttribute and specify the appropriate culture. Second, try going back to the "default" culture (actually the neutral culture) in your form designer and compile again. VS.NET might thing that you're trying to compile the English satellite assembly as the primary assembly. Second, show hidden files in your project. Look at the ResX files. If you use VS.NET's designers, these will be hidden under forms. If your form source file is named MyForm.cs, then you should have a MyForm.resx (the neutral language) and MyForm.en.resx or MyForm.en-US.resx.
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----