I know this is a little late to the party, but here’s how we do it. The key to this is to set the ‘OutputPath’ explicitly to the Build directory. This re-bases it to working directory and not the VS install directory.
-
Update output path for the project to be:
<OutputPath>$(MSBuildProjectDirectory)\bin\</OutputPath> -
Update StartProgram for the project to be:
<StartProgram>$(OutputPath)Relative.exe</StartProgram>
Here is a sample configuration PropertyGroup:
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '0-Local|AnyCPU'">
<!-- default values you should already have in your csproj -->
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<!-- actual output path and start action definition -->
<OutputPath>$(MSBuildProjectDirectory)\bin\</OutputPath>
<StartAction>Program</StartAction>
<StartProgram>$(OutputPath)NServiceBus.Host.exe</StartProgram>
<StartArguments>NServiceBus.Integration</StartArguments>
</PropertyGroup>