How to create c# project file with another project conditional on configuration?

14 Views Asked by At

My project file has following configuration, where ten binaries are included:

<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
  <Reference Include="EFIntegrationV2ForNet8">
    <HintPath>..\CompiledBinaries\ForDebug\dllOne.dll</HintPath>
  </Reference>
...
  <Reference Include="EFIntegrationV2ForNet8">
    <HintPath>..\CompiledBinaries\ForDebug\dllTen.dll</HintPath>
  </Reference>
</ItemGroup>

I would like to have a project, included as a dependency, for debug purposes. I added following:

<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
    .. all dlls references are still there
    <ProjectReference Include="PathToDllOne\DllOne.csproj">
    </ProjectReference>
</ItemGroup>

Now I am getting the error when my project is loaded:

error : Items that are outside Target elements must have one of the following operations: Include, Update, or Remove.

What am I doing wrong? If such config is even allowed? Thanks!

0

There are 0 best solutions below