When working on a larger project, you will often have multiple Visual Studio projects, including one "central" API project. You reference the "central" API from the smaller projects. Depending on how you are developing, referencing, and building the project, you may want to reference a DEBUG dll during development and a RELEASE dll for your production deployments. To do so, you can update the .csproj file in your smaller projects with conditional references.
- Build the "central" API in DEBUG mode.
- In the smaller project, add the DEBUG dll reference to the "central" api.
- In Visual Studio Solution Explorer, double click the name of the smaller project.
- Update the references using the example below.
<ItemGroup Condition="'$(Configuration)'=='Debug'">
<Reference Include="Central.API">
<HintPath>..\..\..\..\Central-API\bin\debug\net8.0\Central.API.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='Release'">
<Reference Include="Central.API">
<HintPath>..\..\..\..\Central-API\bin\Release\net8.0\Central.API.dll</HintPath>
</Reference>
</ItemGroup>