V
V
Vasily Vasilyev2017-09-26 10:26:25
Upwork
Vasily Vasilyev, 2017-09-26 10:26:25

Visual Studio Code + C#. Where can I find the .exe file?

I started making simple C# programs in Visual Studio Code (not Visual Studio!). Soon I noticed a problem: unlike launching in Visual Studio, in Visual Studio Code (with C# extensions), after launching the application from the console, the exe file does not appear in the directory (/bin/Debug), instead of it there is a netcoreapp2.0 folder with . dll & .config.json & .pdb .
Question : how to get the coveted exe-shnik? Except how to rewrite the program in Visual Studio, because projects written in Code do not even run in it. I run via > dotnet run

Answer the question

In order to leave comments, you need to log in

6 answer(s)
S
Semyon Akhrameev, 2019-06-14
@Excruciator

There are three standard methods for withdrawing money on UpWork - to a bank account (you need to check with your bank if direct debit to a dollar account is available, in Russia you can get to the currency control, I don’t know how things are in Belarus), to PayPal - commissions in this the system is just hellish. I personally use the third option of Payoneer - an American service, you can easily register and request the issuance of a MasterCard card, withdrawal fees are minimal, you can withdraw money from almost any ATM anywhere in the world (at least in Europe, in Russia and in my Kyrgyzstan it’s easy it turns out to withdraw money, personally checked).

V
Vasily Vasilyev, 2017-09-26
@Basil_Dev

Solved the issue using the csc compiler directly. To do this, you need to add it to the Path environment (located in C -> Windows -> Net). You can use it through the console: csc Program.cs - voila, an exe file appears next to the code file.

D
Dmitry Eremin, 2017-09-26
@EreminD

what type of project?

S
Sergey, 2017-09-26
@sergey_kzn

https://docs.microsoft.com/en-us/dotnet/core/tools...

E
EagleXK, 2019-03-26
@EagleXK

Looks like this should solve the problem

O
Ox2A, 2019-08-15
@Ox2A

Unfortunately, I also did not find how to create .exe files using netcoreapp2.2. However, they can be created using, for example, the .NET Framework 4.7.2. But here another problem arises - in this case they cannot be debugged.
As a result, we still managed to get out of the situation like this:
1. Corrected the .csproj file of the project.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup Condition=" $(Configuration) == Release  "> 
    <OutputType>Exe</OutputType> 
    <TargetFramework>net472</TargetFramework>
  </PropertyGroup>

  <PropertyGroup Condition=" $(Configuration) == Debug "> 
    <OutputType>Exe</OutputType> 
    <TargetFramework>netcoreapp2.2</TargetFramework>
  </PropertyGroup>

</Project>

2. Now debugging uses netcoreapp2.2. And if I need to create an .exe, then I run the release creation:
dotnet run -c release

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question