Created
September 1, 2013 21:02
-
-
Save slimflem/6407306 to your computer and use it in GitHub Desktop.
This csproj file snippet shows PropertyGroup elements allowing to build a Console application as a Windows Service for Release Configuration and a standard Console application when in Debug. notice Debug is Exe (Console) and Release is WinExe (Windows Service).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> | |
<PlatformTarget>AnyCPU</PlatformTarget> | |
<DebugSymbols>true</DebugSymbols> | |
<DebugType>full</DebugType> | |
<Optimize>false</Optimize> | |
<OutputPath>bin\Debug\</OutputPath> | |
<DefineConstants>DEBUG;TRACE</DefineConstants> | |
<ErrorReport>prompt</ErrorReport> | |
<WarningLevel>4</WarningLevel> | |
<OutputType>Exe</OutputType> | |
<StartupObject>TheProgram.ServiceHost.Program</StartupObject> | |
</PropertyGroup> | |
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"> | |
<PlatformTarget>AnyCPU</PlatformTarget> | |
<DebugType>pdbonly</DebugType> | |
<Optimize>true</Optimize> | |
<OutputPath>bin\Release\</OutputPath> | |
<DefineConstants>TRACE</DefineConstants> | |
<ErrorReport>prompt</ErrorReport> | |
<WarningLevel>4</WarningLevel> | |
<OutputType>WinExe</OutputType> | |
<StartupObject>TheProgram.ServiceHost.WindowsServiceHost</StartupObject> | |
</PropertyGroup> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
WindowsServiceHost is the ServiceBase class. You will also need an Installer class in your project as well.