Visual Studio 2017 : Not generating an .EXE file when building a solution

  • Thread starter Thread starter melocotone
  • Start date Start date
M

melocotone

Guest
I am new to Visual Studio but have a large experience with several programming languages.

I have configured Visual Studio 2017 (Community) to use the directory c:\c#projs for my C# projects, instead of a directory inside the c:\users directory.

I have created a console application project and I can debug and test it without problems. As the application is doing what I want, I want to pickup the generated EXE file in order to deploy it elsewhere. The problem is that Visual Studio is generating a DLL but not an EXE.

I have searched a lot on the NET and tried many things but I get no EXE from Visual Studio. However I was able to produce an EXE using command line. Calling c:\Windows\Microsoft.NET\Framework64\v3.5\csc.exe followed by the path to my .CS application generates the EXE that I need. But this solution is not satisfactory as it should be possible for such a sophisticated product as Visual Studio to generate the EXE directly from inside Visual Studio itself (when I choose "build solution"or "publish") without being necessary to resort to command line.

Here is the contents of my App01.csproj file :

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

<PropertyGroup>
<OutputPath>bin\</OutputPath>
<OutputType>Exe</OutputType>
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
<TargetFramework>netcoreapp2.1</TargetFramework>
<StartupObject>App01.SetDirDatesProgram</StartupObject>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>bin\</OutputPath>
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
<PlatformTarget>x64</PlatformTarget>
<WarningLevel>0</WarningLevel>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutputPath>bin\</OutputPath>
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
<PlatformTarget>x64</PlatformTarget>
<WarningLevel>0</WarningLevel>
</PropertyGroup>

</Project>

I hope somebody is able to direct me in the right direction. The C# and Visual Studio docs are of high quality but they are very large and it would take me a lot of time to discover the solution to this problem I have read bits and pieces here and there, but without success.

Thanks in advance.

Continue reading...
 
Back
Top