Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Compiler error

Compiler error

Scheduled Pinned Locked Moved C#
helpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jose Vicente
    wrote on last edited by
    #1

    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.

    H 1 Reply Last reply
    0
    • J Jose Vicente

      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.

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      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 the assembly: 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 the AssemblyCultureAttribute, 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-----

      J 1 Reply Last reply
      0
      • H Heath Stewart

        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 the assembly: 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 the AssemblyCultureAttribute, 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-----

        J Offline
        J Offline
        Jose Vicente
        wrote on last edited by
        #3

        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.

        H 1 Reply Last reply
        0
        • J Jose Vicente

          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.

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          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-----

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups