I have just installed Visual C# 2005 Express Edition and all was well.
One day later and I can't debug a new project as I get the error: "The following module was built either with optimizations enabled or without debug information"
I can create a new command line project and add the following line of code:
This runs fine...no problem. However when I change that line to:
I get the above error. I cannot debug any code once it has changed. I've seen some other posts with the same error but no clear solution.
I have worked out that when I delete the .exe file from the bin\debug directory it all works again. The code debugs fine and runs.
It is as if C# cannot overwrite the .exe in the debug phase. It's not in the user configuration as I have logged in as another user and run C# 'for the first time' and the problem remains. I have also reinstalled C#.