none
C# console application compiles to .dll and not .exe RRS feed

  • Question

  • I have a C# console application but it only compiles to a .dll and not what I want (.exe)

    I'm using Visual Studio 2017 for everything

    Monday, January 1, 2018 3:07 PM

Answers

  • Yes I rebuilt the application

    Did you actually do a *Rebuild* or did you do a *Build*?

    Recommended steps:

    (1) From the "Build" menu click on "Clean Solution".

    (2) From the "Build" menu click on "Rebuild Solution".

    (3) Check the bin folders, and make sure the dates on the files
        reflect the latest Rebuild.
        
    - Wayne

    Monday, January 1, 2018 10:15 PM

All replies

  • In the property settings of your project under 'Application' the output type needs to be 'Console Application' and not 'Class Library' as in your case.

    wizend

    Monday, January 1, 2018 3:15 PM
  • Oh. Was a Windows Application. Changed it to Console Application

    It's still not working though.

    Monday, January 1, 2018 3:33 PM
  • Does it still compile to a dll? Did you rebuild your application after changing the settings. 

    wizend

    Monday, January 1, 2018 3:39 PM
  • Yes I rebuilt the application
    Monday, January 1, 2018 9:22 PM
  • Yes I rebuilt the application

    Did you actually do a *Rebuild* or did you do a *Build*?

    Recommended steps:

    (1) From the "Build" menu click on "Clean Solution".

    (2) From the "Build" menu click on "Rebuild Solution".

    (3) Check the bin folders, and make sure the dates on the files
        reflect the latest Rebuild.
        
    - Wayne

    Monday, January 1, 2018 10:15 PM
  • Rebuild, as in: "Build | Rebuild Solution" from the VS menu, not F6. Is that what you did? Are you looking for the EXE in the correct folder (bin\debug or bin\Release, depending on what your Build setting is)?

    ~~Bonnie DeWitt [C# MVP]

    http://geek-goddess-bonnie.blogspot.com


    Monday, January 1, 2018 10:19 PM
    Moderator
  • Hi yperz,

    After rebuilding your solution please go to your projects "bin" folder there you will a .dll file created with your project name, that .dll file you can use for referencing.


    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    Tuesday, January 2, 2018 1:55 PM
    Moderator
  • Are you using .Net Core 2.0?  It builds to a dll.
    Tuesday, January 2, 2018 3:31 PM
  • Hello yperz,

    Is there any update or any other assistance I could provide? You could mark the helpful reply as answer if the issue has been solved. And if you have any concerns, please do not hesitate to let us know.

    Thank you for your understanding and patience!

    Best regards,

    Neil Hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Sunday, January 28, 2018 12:20 PM
    Moderator
  • You have built your Console Application using .Net Core

    You need to build it using .NetFramework.

    Start a new project and choose Console Application(.Net Framework)

    Sunday, December 2, 2018 7:00 PM
  • I was having the same issue... Thanks for the help!
    Thursday, February 7, 2019 8:51 PM
  • me too thank you KushanA!
    Wednesday, August 28, 2019 9:58 PM