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

  • Question

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

      <Choose>

        <When Condition="'$(Configuration)' == 'Local'">

          <ItemGroup>

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

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

              <Name>Idw.MvcLib</Name>

            </ProjectReference>

            <ProjectReference Include="..\..\..\..\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:

        <Reference Include="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.

    Monday, July 15, 2019 7:44 AM

All replies

  • Hi LinusFI,

    Thank you for posting here.

    According to this warning, please try the below steps in VS2019:

    #open Tools -> Options -> Debugging -> General, disable "Suppress JIT optimization on module mode(Managed only)" and "Enable Just My Code".

    Then check if it could work normally.

    Any feedback will be expected.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Tuesday, July 16, 2019 3:26 AM
  • Hi friend,

    Sorry to disturb you and just want to confirm if this issue is solved or not. You can try Dylan's suggestion and check if it helps to resolve the issue.

    If it persist, please feel free to let us know.

    Also, since this error message indicates you're debugging an assembly with optimizations. You can try Right-click project=>properties =>Build=>uncheck the Optimize Code to resolves this issue. Just like what suggests in this issue, unchecked “Optimize code” option in all projects (debugged one and all of it dependence projects) then breakpoints will be hit. And note: make sure the solution is in debug mode, and the assembly you referenced is built with no optimizations

    Hope it helps:)

    Sincerely

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 2, 2019 8:49 AM