Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

180
Vistas
How can I change the executable filename and icon for different build configurations?

I want to have a different icon and executable file name for different builds of my WPF application. The reason is that I have two different version of the app which are slightly different (just a few items disabled, color changes etc) So I used two different build configurations and the App.config transforms to do that for example in my transform I have several transformations like this

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 
  <appSettings xdt:Transform="Replace"> 
    <add key="appTitle" value="Application Name 2"/> 
    <add key="appIcon" value="Icons\appplicationIcon2.ico"/> 
  </appSettings> 
</configuration> 

And then in my app I read the configuration setting for that property, appTitle or appIcon, and I perform some cosmetic or other changes to the app based on that.

But can I also use this to apply a change on the application icon itself (the one that gets embedded in the EXE, or the name of the EXE file?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

In addition to the answer linked here https://stackoverflow.com/a/32977405/1462656 To change the application executable name on compile you must add the following as well to the property group

<AssemblyName>Name For Executable</AssemblyName>

So the property group should have these two additions

  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Your Configuration Name|x64'">
    <ApplicationIcon>Icons\YourIconFilename.ico</ApplicationIcon>
    <AssemblyName>Your Application Name</AssemblyName>
    ...
  </PropertyGroup>

EDIT: I noticed that this does not have any effect on the Product Name or File Description as seen when you right click and view property details of the executable from File Explorer. To also have different values for Product and File Description do he following

  • Add Conditional Compilation Symbols in the Build properties for the project configuration
  • In the AssemblyInfo.cs do something like this
    #if APPONE
        [assembly: AssemblyTitle("App 1")]
    #else
        [assembly: AssemblyTitle("App 2")]
    #endif
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda