This was resolved although the 'solution' may appear unfulfilling. The file and line that the internal compiler error mentioned was not my code but from a lib I was using that was compiled in a separate solution and project. I did not realize that immediately. Soon after I commented that my change was having no effect above I tried to compile the lib code without optimizations and then attempted to recompile my code. That did not work either. In the end I just moved two lines of code from line x to line x + 20 (within the same block so it didn't matter where it was) and then built the lib again and then rebuilt my work and it worked. There is no doubt that there was some config difference between release and debug and may be if I had kept pressing I could have figured out what optimization or config was at fault but I am rushed now and just needed to have this running.
So in the end, to resolve, had something like this.
{
blah1
blah2
blah3
blah4 //the line the compiler error mentioned
blah5
blah6
blah7
blah8
}
changed to:
{
blah1
blah2
blah3
blah6
blah7
blah8
blah4
blah5
}
I guess any random change like this would have worked, this way just happened to work on the first attempt.
There are similar resolutions already on StackOverFlow, what threw me off for a while was the debug/release difference and the fact that the code I had to change was from a different solution and project and I had to rebuild two separate solutions.