question

MosheWiener-0469 avatar image
2 Votes"
MosheWiener-0469 asked SamuelStallone-5087 published

Build a stand-alone executable by Visual Studio 2019 Community

I have Visual Studio 2019 Community. I try to create a stand-alone executable out of a .NET Console project. Yet, the .exe I get needs several DLLs from the VS environment. I want to run the EXE on a computer in which VS is not installed., How do I create a true self contained EXE?

dotnet-csharp
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


the .exe I get needs several DLLs from the VS environment.

Which DLLs and features from Visual Studio do you need?

0 Votes 0 ·

C Programming and Coding Standards: Passing the Test of Time


0 Votes 0 ·
Castorix31 avatar image
0 Votes"
Castorix31 answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

abbodi86-0005 avatar image
0 Votes"
abbodi86-0005 answered

If you mean external or 3rd party reference assemblies, you can merge them
https://github.com/dotnet/ILMerge
https://github.com/gluck/il-repack

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TimonYang-MSFT avatar image
3 Votes"
TimonYang-MSFT answered SamuelStallone-5087 published

Are you using .net framework or .net core?

If it is .net core, please try the following steps:

  1. Right-click on the project and select Publish.

  2. Choose the location you want to deploy, as an example, I choose the folder, and then next->finish.
    44053-1.png


  3. Click Edit, set Deployment Mode to Self-contained, expand File publish options, and select Produce single file.
    44046-2.png


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



1.png (18.9 KiB)
2.png (26.0 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, when I click Edit it takes me into the pubxml and not the Profile Settings dialog shown above, any ideas?

1 Vote 1 ·

IThis option comes in one of the wizard windows of the clickonce publish options, if you choose your target framework to be win-64x etc.

0 Votes 0 ·

It's works, thank you so much!!

0 Votes 0 ·