Share via

My Project is not creating an .exe file

Rodney Matthews 0 Reputation points
2026-04-08T09:45:57.34+00:00

My Project is not creating an .exe file in the Bin folder

Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.


2 answers

Sort by: Most helpful
  1. Nancy Vo (WICLOUD CORPORATION) 2,305 Reputation points Microsoft External Staff Moderator
    2026-04-09T06:04:57.98+00:00

    Hi @Rodney Matthews ,

    Thank you for your inquiry.

    • Please make sure you created an app project (Console/WPF/WinForms...), not Class Library. If the project is a class library, the output would be a DLL and not an EXE. In that case, check the output folder at ...\bin\Debug\netX.Y\ (or ...\bin\Release\netX.Y\).
    • Do the Output window or the Error List show any build errors? If so, please resolve those first and then rebuild the project.
    • If you change the project configuration, the output (EXE) may be generated in a different folder than the default one.

    I have created a new Console App and did not change anything. It produces both an .exe and a .dll.

    Note: I am using visual studio 2026, .NET 10

    image

    Please double-check whether your project is a class library. If it is, try creating an application project instead and let me know if that resolves the issue.

    I hope this addresses your question. If this response was helpful, please consider following the guidance to provide feedback.

    0 comments No comments

  2. Q&A Assist
    2026-04-08T09:46:12.69+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    In MSBuild-based C# projects, the .exe is created only when the project and build configuration are set up correctly and the build actually succeeds.

    Check the following:

    1. Confirm the project type
      • Only Console or Windows Application projects produce an .exe. Class Library projects produce a .dll instead.
      • If a library is expected to be an application, create a Console App project and move the Main entry point there.
    2. Verify OutputPath and AssemblyName
      • Open the project file (.csproj or custom .proj) and ensure an OutputPath and AssemblyName are defined, similar to:
             <Project DefaultTargets="Build">
               <PropertyGroup>
                 <AssemblyName>MyApp</AssemblyName>
                 <OutputPath>Bin\</OutputPath>
               </PropertyGroup>
               <Target Name="Build">
                 <MakeDir Directories="$(OutputPath)" Condition="!Exists('$(OutputPath)')" />
                 <Csc Sources="@(Compile)" OutputAssembly="$(OutputPath)$(AssemblyName).exe" />
               </Target>
             </Project>
        
      • Note the trailing backslash in OutputPath (Bin\). This ensures the compiler writes MyApp.exe into the Bin folder.
    3. Build from the command line
      • In a Developer Command Prompt, navigate to the folder that contains the project file and run:
             msbuild MyProject.csproj -t:Build
        
        or, for a custom MSBuild project file:
             msbuild helloworld.fromscratchproj -t:Build
        
      • After a successful build, verify the output:
             dir Bin
        
        The expected *.exe should appear there.
    4. Check for build errors
      • If the build fails, no .exe will be produced. Review the MSBuild output for errors and fix them, then rebuild.
    5. Clean and rebuild
      • If the project file defines Clean and Rebuild targets, use them to force a fresh build:
             msbuild MyProject.csproj -t:Rebuild
        
      • A typical setup is:
             <Target Name="Clean">
               <Delete Files="$(OutputPath)$(AssemblyName).exe" />
             </Target>
             <Target Name="Rebuild" DependsOnTargets="Clean;Build" />
        

    Once AssemblyName, OutputPath, and the Csc task (or standard project build) are configured correctly and the build succeeds, the .exe will be created in the Bin folder and can be run, for example:

    Bin\MyApp
    

    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.