I have developed a C# console application that is working properly from inside the Visual Studio environment. When I choose "Build Solution" under "Release" (but also under "Debug") a .DLL is generated, not an .EXE. I'm able to generate the .EXE using command line ("c:\Windows\Microsoft.NET\Framework64\v3.5\csc.exe" followed by the path to the .cs file), but it should be possible to generate the .EXE from inside the Visual Studio environment.
I have configured Visual Studio to use "C:\c#projs" as my projects location (menu path "Tools"->"Options"->"Projects and Solutions"->"Projects Location" instead of the default path under c:\Users\\Documents....
Here is the project file "App01.csproj"
<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>
And here is the generated "App01.deps.json" file:
"runtimeTarget": {
"name": ".NETCoreApp,Version=v2.1",
"signature": "da39a3ee5e6b4b0d3255bfef95601890afd80709"
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v2.1": {
"App01/1.0.0": {
"runtime": {
"App01.dll": {}
}
}
}
},
"libraries": {
"App01/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
The "App01.deps.json" file was created by Visual Studio and contains (under the "runtime" key) "App01.dll" instead of "App01.exe".
My question is: What do I need to modify in Visual Studio in order to get (under the "runtime" key) "App01.exe" instead of "App01.dll" and obviously in order for App01.exe to be generated by Visual Studio so that I can deploy App01.exe elsewhere?