Core Code built in Debug mode when updated but not in Release

A user found a bug in one of my apps and I fixed it. It was in my core code and the fix worked in the Debug version but I found that when I built the Release the fix wasn't there. I had to do a Rebuild of the Solution to get it included. This is not the behavior I expected and seems to be a bug. Why would it get built in the Debug but NOT the Release? This was with version 15.6.2 of Visual Studio 2017 and effected both the Android and UWP builds using PCL.

Best Answer

  • BrianConradBrianConrad US ✭✭✭
    Accepted Answer

    @ClintStLaurent said:
    Just to confirm... You're saying it doesn't compile the new version, in release, on the build server elsewhere. ??
    What does it do on your local machine if you do a release build?

    I only build on my local machine and the problem arose there. However testing the build with version 15.6.3 the problem seems to be resolved.

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Look at the Configuration Manager.
    Is the project checked on to be built in release mode?

  • BrianConradBrianConrad USMember ✭✭✭

    Yes, it is checked.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Huh... And if you manually choose to build each project then it all works. But if you choose "rebuild solution" then a given project doesn't rebuild automatically?

  • BrianConradBrianConrad USMember ✭✭✭

    @ClintStLaurent said:
    Huh... And if you manually choose to build each project then it all works. But if you choose "rebuild solution" then a given project doesn't rebuild automatically?

    No, the changed code got built in the Debug version both for Android and UWP. But it didn't get built in the Release version of both. I had to select Rebuild to get it included. It used to work without doing a Rebuild on a Release version.

    I also thought it might be because it's a PCL project which isn't supported so much anymore but yesterday when updating some code in a .Net Standard project that code didn't get updated either and that was just in Debug mode.

    I've learned after all these years that this can happen if some developer failed to initialize or refresh flags in the build system. We're probably dealing with a bit of a conservatively funded project where some things are not a big priority to fix. After all to fix some things you still have exit VS and run it again for it to build without any errors even on code that previously built okay.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @BrianConrad said:
    No, the changed code got built in the Debug version both for Android and UWP. But it didn't get built in the Release version of both. I had to select Rebuild to get it included. It used to work without doing a Rebuild on a Release version.

    Ah. Gotcha now. That is very weird.

    I also thought it might be because it's a PCL project which isn't supported so much anymore

    -ish. Its not available in the new solution template. My current project dates back to 2016 and is a PCL and continues to work fine. So I can at least let you know that's not it.

    I've learned after all these years that this can happen if some developer failed to initialize or refresh flags in the build system.

    Just to confirm... You're saying it doesn't compile the new version, in release, on the build server elsewhere. ??
    What does it do on your local machine if you do a release build?

  • BrianConradBrianConrad USMember ✭✭✭
    Accepted Answer

    @ClintStLaurent said:
    Just to confirm... You're saying it doesn't compile the new version, in release, on the build server elsewhere. ??
    What does it do on your local machine if you do a release build?

    I only build on my local machine and the problem arose there. However testing the build with version 15.6.3 the problem seems to be resolved.

Sign In or Register to comment.