locked
how to change exe name C#(very urgent) RRS feed

  • Question

  • hello

               i have create an application  C# desktop application , 2008 with name "myproject" . after completing the work i have rename the soultion , project, and the folder that contain project name to "CRM" .

     

    but every time i build exe name does not change

     


    It's Me
    Thursday, June 17, 2010 5:15 AM

Answers

  • You need to change Name from the properties.

    Right Click on project -> Click on properties ->  And there is one tab with name application Click on that. You will find two text box one for AssemblyName (Change this to CRM)

    After that your exe name will be CRM.exe.


    Regards
    Nayan Paregi (MCTS)
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Proposed as answer by Nayan Paregi Thursday, June 17, 2010 6:05 AM
    • Marked as answer by It_s Meee Thursday, June 17, 2010 7:22 AM
    Thursday, June 17, 2010 5:22 AM

All replies

  • You need to change Name from the properties.

    Right Click on project -> Click on properties ->  And there is one tab with name application Click on that. You will find two text box one for AssemblyName (Change this to CRM)

    After that your exe name will be CRM.exe.


    Regards
    Nayan Paregi (MCTS)
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Proposed as answer by Nayan Paregi Thursday, June 17, 2010 6:05 AM
    • Marked as answer by It_s Meee Thursday, June 17, 2010 7:22 AM
    Thursday, June 17, 2010 5:22 AM
  • right click on your solution in solution explorer and select properties option
    then select application tab
    and change the Assembly name.
    it will change your .exe file name 

     

    regards

    jayant

    Thursday, June 17, 2010 5:25 AM
  • Hello,

           For changing the name of the exe of your application, please follow the steps mentioned below:

    1. Right Click your project in Solution Explorer

    2. Click on the Properties

    3. Select the application tab

    4. Change the assembly name to whatever new name you want to have of your exe.

     

    Thanks,

    Paras Sanghani

    Mark As Answer if it helped you.

    • Proposed as answer by Paras Sanghani Thursday, June 17, 2010 6:28 AM
    Thursday, June 17, 2010 5:25 AM
  • I find it most irksome that the .exe name is forced to be the same as the assembly name.

    We use a naming convention for our assemblies of CompanyName.TechnologyName.Whatever - this applies to .exes as well as to .dlls.

    This is clearly a very wanky name for the users to deal with, particularly when the program is already installed in an appropriately named subfolder. We therefore always have to rename the executable in the installer. It's a bit rubbish, eh?

    [EDIT] It censored a very mild swear word. I have replaced it with a suitable alternative. ;)

    Thursday, June 17, 2010 9:12 AM
  • I find it most irksome that the .exe name is forced to be the same as the assembly name.

    The exe is an assembly. Of course it has the same name as itself.
    Thursday, June 17, 2010 9:53 AM
  • I find it most irksome that the .exe name is forced to be the same as the assembly name.

    The exe is an assembly. Of course it has the same name as itself.

    But it doesn't need to have. You can rename the .exe file, but afterwards it still has the same assembly name.

    Try this:

    using System;
    using System.Reflection;

    namespace Demo
    {
        internal class Program
        {
            private static void Main()
            {
                Console.WriteLine("GetExecutingAssembly = " + Assembly.GetExecutingAssembly().FullName);
            }
        }
    }

    Compile and run it, and by default the executing assembly will indeed have the same name as the exectuable.

    Now rename the executable and run it again. Has the assembly name changed to the renamed executable name? No, it hasn't, because .exe filename != assembly name.

    That's what I'm talking about. The IDE should let us choose a separate assembly name and .exe name, if we wish.

    The assembly name should be unique, and named using a proper naming convention. The .exe should be named for convenience for the user. The two names are not usually the same.

    (Note: We use tools that generate scripts for MSBuild, that rely on unique assembly names.)

    Thursday, June 17, 2010 10:14 AM
  • Right. You wrote "assembly name", I read "assembly filename".

    I never needed having an exe with an assembly name different from the file name. Maybe you can use a manifest to set the assembly name.

    Thursday, June 17, 2010 7:46 PM
  • It's merely a convenience for the user. Most companies ship .exes with short names.

    For example, the Visual Studio executable is called "Devenv.exe", not something like "Microsoft.VisualStudio.Devenv.exe", and Microsoft Word is called "winword.exe", not "Microsoft.Office.WinWord.exe".

    Thursday, June 17, 2010 11:31 PM
  • I understand why you would want a short filename. But why would you need to have a long assembly name?
    Thursday, June 17, 2010 11:38 PM
  • Because we want our assemblies to be uniquely named.

    We develop quite a lot of software, and (for example) we have two separate programs that are both called "ReportGenerator". If we used the same assembly name for both of them, it would cause problems with the tools that we use to automatically build and run MSProj projects.

    More specifically, we can build a particular assembly using our tools, and naturally we identify the assembly to build by specifying its assembly name. If two assemblies had the same name, this would not be possible. (There are other things that would fail if we didn't use unique assembly names too, but one reason is enough, I think. :)

    Also don't forget that executable assemblies can still be referenced as class libraries (although we do not do that). Having unique names for assemblies can be important if you ARE doing that.

     

    Friday, June 18, 2010 8:38 AM
  • Thank you.
    Thursday, August 6, 2015 10:37 PM
  • I am sorry, but I cannot follow these instructions.

    In the Solution Explorer, I have

    Solution 'MyTestProject'

    with a project called MyTestAp containing one file Testing.cs.

    In Testing.cs I have one class called Testing, containing one method called Main

    Now, when I select MyTestProject -> Properties, I get a window that says

    Solution 'MyTestProject' Property Pages.  In there I see no tab called "name application" or anything like it.  

    When I build, I get an executable called: ConsoleApplication1.exe.  This is not what I want.
    I am sure that I could fix this by editing the .vsproj or .sln file, but this should not be the right way (probably the easiest, however, as far as I can see). 

    Monday, December 5, 2016 3:23 AM
  • OK, worked it out (I think).  I have to open the MyTestAp -> Properties page.  Then I see the Assembly Name tab.  In fact, editing the MyTestAp.csproj file directly with a text editor was the easiest way to fix this.
    Monday, December 5, 2016 3:30 AM
  • Old post, but found while searching.

    I wanted to have differnt names  for Assembly and .exe for use in PortableApps platform.

    To create an .exe file with the name StartAtom.exe, which is displayed in PortableApps Menu as Atom.exe, the clue is in the last post by RIH.ANU

    Change the Assembly name to StartAtom

    Change the 'Title' property in the 'Assembly Information' dialog to Atom.

    The reson for doing all this is so the portable version of Atom does not complain that 'Atom is already running' because it is being started by a file with the same name. I assume it is just checking the WindowTitle of running apps for this purpose.

    Why do I need my own launcher? To set the config files for Atom when running from different drive letters before launching the app.

    Sunday, August 25, 2019 2:18 PM