Quantcast
Channel: MSBuild forum
Viewing all articles
Browse latest Browse all 2763

VS2019: Choose - When Condition=" '$(Configuration)'=='MyConfig' " not working anymore

$
0
0

I have a configuration named "local". This configuration compiles and links all my custom libraries with my application:

 <Choose>

   <WhenCondition="'$(Configuration)' == 'Local'">

     <ItemGroup>

       <ProjectReferenceInclude="..\..\..\..\Komponenten2\Idw.MvcLib\trunk\_apl\Idw.MvcLib.csproj">

         <Project>{751101e1-6d1d-4450-b647-8042ddd1d187}</Project>

         <Name>Idw.MvcLib</Name>

       </ProjectReference>

       <ProjectReferenceInclude="..\..\..\..\Komponenten2\LINQtoCSV\trunk\_apl\LINQtoCSV.csproj">

         <Project>{07058bf9-6f86-40ff-ae33-2a4f89b5758a}</Project>

         <Name>LINQtoCSV</Name>

       </ProjectReference>

     </ItemGroup>

   </When>

   <Otherwise>

     <ItemGroup>

     </ItemGroup>

   </Otherwise>

 </Choose>


With other configurations ("test", "production") these libraries are referenced by Nuget with the inversed condition:

   <ReferenceInclude="Idw.MvcLib, Version=2017.3.0.3, Culture=neutral, processorArchitecture=MSIL"Condition="'$(Configuration)' != 'Local'">

     <HintPath>..\packages\Idw.MvcLib.2017.3.0.3\lib\net461\Idw.MvcLib.dll</HintPath>

   </Reference>

With Visual Studio 2019 it takes always the NuGet reference instead of the project ref. I noticed it when I am trying to debug. The debugger issues a "Just My Code Warning": "You are debugging a Release buld of xxx.dll. Using Just My Code with Release builds using compiler optimizations results in a degrades debugging experience (e.g. breakpoints will not be hit)" With Visual Studio 2017 the same project works fine.


Viewing all articles
Browse latest Browse all 2763

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>