Visual Studio 15: rebuild modified .cu files

I’m having a problem where if I modify my header file and build, Microsoft Visual Studio 2015 does not pick this modification up. What I want is for MSVC to pick up the modification in the header file, and recompile the .cu files that #include it. This used to work, but for some reason it doesn’t anymore.

Here is my minimal example:

constant.h

#ifndef CONSTANT_H
#define CONSTANT_H

namespace constant
{
    const int arraySize{ 10 };
}

#endif

main.cu

#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include "constant.h"
#include <stdio.h>

int main()
{
    // Declaration.
    const int arraySize = constant::arraySize;
    int a[arraySize];
    int b[arraySize];
    int c[arraySize];

    // Initialization.
    for (int i = 0; i < arraySize; ++i)
    {
        a[i] = i;
        b[i] = 10 * i;
        c[i] = 0;
    }

    ...
    // Call some kernels to produce vector c
    // and print result.
    ...

    return 0;
}

If I do an initial build, then change arraySize in constant.h to say 5 instead of 10, followed by another build, the application still creates an array of length 10 instead of the new modified 5. I.e. main.cu isn’t being recompiled after constant.h has been modified. As previously mentioned, main.cu used to recompile upon constant.h modification, but it does not anymore.

I’ve tried setting Source Dependencies to “constant.h” on the main.cu property page, but this did not work. Any ideas?