How to run .NET core application by double clicking a file like exe in .NET framework
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.
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
add a comment |
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.
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
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
add a comment |
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.
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
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.
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
c# .net .net-core
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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
Please uselinux-x64
instead of an os-specific RID likeubuntu.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
add a comment |
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
Please uselinux-x64
instead of an os-specific RID likeubuntu.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
add a comment |
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
Please uselinux-x64
instead of an os-specific RID likeubuntu.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
add a comment |
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
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
answered Nov 26 '18 at 8:43
Marcin TyborowskiMarcin Tyborowski
322
322
Please uselinux-x64
instead of an os-specific RID likeubuntu.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
add a comment |
Please uselinux-x64
instead of an os-specific RID likeubuntu.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
add a comment |
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
add a comment |
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
add a comment |
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
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
answered Nov 26 '18 at 8:51
Marcus HöglundMarcus Höglund
9,90062748
9,90062748
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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