How to run .NET core application by double clicking a file like exe in .NET framework












2















In .NET framework when we build our solution/project, we get an exe in the debug/release folder and we can run our application by double clicking that exe. But how can we do this in .NET core, i know we can't have an exe in .NET core because it is windows specific. When i build my .NET core application i get the following files in the debug folder.enter image description here



I know how to run this application using command prompt but i want to have a file like exe by clicking which i can run my application.










share|improve this question























  • Use the Process.Start() method

    – Kunal Mukherjee
    Nov 26 '18 at 8:38











  • Can you provide me a bit more information @KunalMukherjee

    – Waleed Naveed
    Nov 26 '18 at 8:45








  • 1





    Possible duplicate of Build .NET Core console application to output an EXE?

    – Caius Jard
    Nov 26 '18 at 8:46
















2















In .NET framework when we build our solution/project, we get an exe in the debug/release folder and we can run our application by double clicking that exe. But how can we do this in .NET core, i know we can't have an exe in .NET core because it is windows specific. When i build my .NET core application i get the following files in the debug folder.enter image description here



I know how to run this application using command prompt but i want to have a file like exe by clicking which i can run my application.










share|improve this question























  • Use the Process.Start() method

    – Kunal Mukherjee
    Nov 26 '18 at 8:38











  • Can you provide me a bit more information @KunalMukherjee

    – Waleed Naveed
    Nov 26 '18 at 8:45








  • 1





    Possible duplicate of Build .NET Core console application to output an EXE?

    – Caius Jard
    Nov 26 '18 at 8:46














2












2








2


1






In .NET framework when we build our solution/project, we get an exe in the debug/release folder and we can run our application by double clicking that exe. But how can we do this in .NET core, i know we can't have an exe in .NET core because it is windows specific. When i build my .NET core application i get the following files in the debug folder.enter image description here



I know how to run this application using command prompt but i want to have a file like exe by clicking which i can run my application.










share|improve this question














In .NET framework when we build our solution/project, we get an exe in the debug/release folder and we can run our application by double clicking that exe. But how can we do this in .NET core, i know we can't have an exe in .NET core because it is windows specific. When i build my .NET core application i get the following files in the debug folder.enter image description here



I know how to run this application using command prompt but i want to have a file like exe by clicking which i can run my application.







c# .net .net-core






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 26 '18 at 8:32









Waleed NaveedWaleed Naveed

120310




120310













  • Use the Process.Start() method

    – Kunal Mukherjee
    Nov 26 '18 at 8:38











  • Can you provide me a bit more information @KunalMukherjee

    – Waleed Naveed
    Nov 26 '18 at 8:45








  • 1





    Possible duplicate of Build .NET Core console application to output an EXE?

    – Caius Jard
    Nov 26 '18 at 8:46



















  • Use the Process.Start() method

    – Kunal Mukherjee
    Nov 26 '18 at 8:38











  • Can you provide me a bit more information @KunalMukherjee

    – Waleed Naveed
    Nov 26 '18 at 8:45








  • 1





    Possible duplicate of Build .NET Core console application to output an EXE?

    – Caius Jard
    Nov 26 '18 at 8:46

















Use the Process.Start() method

– Kunal Mukherjee
Nov 26 '18 at 8:38





Use the Process.Start() method

– Kunal Mukherjee
Nov 26 '18 at 8:38













Can you provide me a bit more information @KunalMukherjee

– Waleed Naveed
Nov 26 '18 at 8:45







Can you provide me a bit more information @KunalMukherjee

– Waleed Naveed
Nov 26 '18 at 8:45






1




1





Possible duplicate of Build .NET Core console application to output an EXE?

– Caius Jard
Nov 26 '18 at 8:46





Possible duplicate of Build .NET Core console application to output an EXE?

– Caius Jard
Nov 26 '18 at 8:46












2 Answers
2






active

oldest

votes


















1














You can generate exe (self-contained application).



.NET Core 2.0 +
Open Package Manager Console or any other console in your project directory and type:



dotnet publish -c Release -r win10-x64
dotnet publish -c Release -r ubuntu.16.10-x64


When you use previous version of .NET Core you have to add runtime identifier of the target environment in csproj:



<PropertyGroup>
<RuntimeIdentifiers>win10-x64;ubuntu.16.10-x64</RuntimeIdentifiers>
</PropertyGroup>


Runtime Identifiers (RIDs) list:
https://docs.microsoft.com/en-us/dotnet/core/rid-catalog






share|improve this answer
























  • Please use linux-x64 instead of an os-specific RID like ubuntu.16.10-x64. The first one will run on all new-ish linux distributions. The second wont even run on the next version of ubuntu.

    – omajid
    Nov 26 '18 at 16:48



















0














One simple solution is to create a .bat file with runs the dll via the dotnet cli, then you get "a file like exe"



dotnet ConsoleApp2.dll





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53477229%2fhow-to-run-net-core-application-by-double-clicking-a-file-like-exe-in-net-fram%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    You can generate exe (self-contained application).



    .NET Core 2.0 +
    Open Package Manager Console or any other console in your project directory and type:



    dotnet publish -c Release -r win10-x64
    dotnet publish -c Release -r ubuntu.16.10-x64


    When you use previous version of .NET Core you have to add runtime identifier of the target environment in csproj:



    <PropertyGroup>
    <RuntimeIdentifiers>win10-x64;ubuntu.16.10-x64</RuntimeIdentifiers>
    </PropertyGroup>


    Runtime Identifiers (RIDs) list:
    https://docs.microsoft.com/en-us/dotnet/core/rid-catalog






    share|improve this answer
























    • Please use linux-x64 instead of an os-specific RID like ubuntu.16.10-x64. The first one will run on all new-ish linux distributions. The second wont even run on the next version of ubuntu.

      – omajid
      Nov 26 '18 at 16:48
















    1














    You can generate exe (self-contained application).



    .NET Core 2.0 +
    Open Package Manager Console or any other console in your project directory and type:



    dotnet publish -c Release -r win10-x64
    dotnet publish -c Release -r ubuntu.16.10-x64


    When you use previous version of .NET Core you have to add runtime identifier of the target environment in csproj:



    <PropertyGroup>
    <RuntimeIdentifiers>win10-x64;ubuntu.16.10-x64</RuntimeIdentifiers>
    </PropertyGroup>


    Runtime Identifiers (RIDs) list:
    https://docs.microsoft.com/en-us/dotnet/core/rid-catalog






    share|improve this answer
























    • Please use linux-x64 instead of an os-specific RID like ubuntu.16.10-x64. The first one will run on all new-ish linux distributions. The second wont even run on the next version of ubuntu.

      – omajid
      Nov 26 '18 at 16:48














    1












    1








    1







    You can generate exe (self-contained application).



    .NET Core 2.0 +
    Open Package Manager Console or any other console in your project directory and type:



    dotnet publish -c Release -r win10-x64
    dotnet publish -c Release -r ubuntu.16.10-x64


    When you use previous version of .NET Core you have to add runtime identifier of the target environment in csproj:



    <PropertyGroup>
    <RuntimeIdentifiers>win10-x64;ubuntu.16.10-x64</RuntimeIdentifiers>
    </PropertyGroup>


    Runtime Identifiers (RIDs) list:
    https://docs.microsoft.com/en-us/dotnet/core/rid-catalog






    share|improve this answer













    You can generate exe (self-contained application).



    .NET Core 2.0 +
    Open Package Manager Console or any other console in your project directory and type:



    dotnet publish -c Release -r win10-x64
    dotnet publish -c Release -r ubuntu.16.10-x64


    When you use previous version of .NET Core you have to add runtime identifier of the target environment in csproj:



    <PropertyGroup>
    <RuntimeIdentifiers>win10-x64;ubuntu.16.10-x64</RuntimeIdentifiers>
    </PropertyGroup>


    Runtime Identifiers (RIDs) list:
    https://docs.microsoft.com/en-us/dotnet/core/rid-catalog







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 26 '18 at 8:43









    Marcin TyborowskiMarcin Tyborowski

    322




    322













    • Please use linux-x64 instead of an os-specific RID like ubuntu.16.10-x64. The first one will run on all new-ish linux distributions. The second wont even run on the next version of ubuntu.

      – omajid
      Nov 26 '18 at 16:48



















    • Please use linux-x64 instead of an os-specific RID like ubuntu.16.10-x64. The first one will run on all new-ish linux distributions. The second wont even run on the next version of ubuntu.

      – omajid
      Nov 26 '18 at 16:48

















    Please use linux-x64 instead of an os-specific RID like ubuntu.16.10-x64. The first one will run on all new-ish linux distributions. The second wont even run on the next version of ubuntu.

    – omajid
    Nov 26 '18 at 16:48





    Please use linux-x64 instead of an os-specific RID like ubuntu.16.10-x64. The first one will run on all new-ish linux distributions. The second wont even run on the next version of ubuntu.

    – omajid
    Nov 26 '18 at 16:48













    0














    One simple solution is to create a .bat file with runs the dll via the dotnet cli, then you get "a file like exe"



    dotnet ConsoleApp2.dll





    share|improve this answer




























      0














      One simple solution is to create a .bat file with runs the dll via the dotnet cli, then you get "a file like exe"



      dotnet ConsoleApp2.dll





      share|improve this answer


























        0












        0








        0







        One simple solution is to create a .bat file with runs the dll via the dotnet cli, then you get "a file like exe"



        dotnet ConsoleApp2.dll





        share|improve this answer













        One simple solution is to create a .bat file with runs the dll via the dotnet cli, then you get "a file like exe"



        dotnet ConsoleApp2.dll






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 26 '18 at 8:51









        Marcus HöglundMarcus Höglund

        9,90062748




        9,90062748






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53477229%2fhow-to-run-net-core-application-by-double-clicking-a-file-like-exe-in-net-fram%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Contact image not getting when fetch all contact list from iPhone by CNContact

            count number of partitions of a set with n elements into k subsets

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks