We have a file with the following code in:
string libraryDirectory = @"..\..\Methods";
string libraryDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "MethodFiles");
In release build, this requires:
But in debug build, neither of these 'usings' is necessary.
The problem is that various refactoring activities (which are inevitably done with 'debug' configuration active) cause R# to remove the 'using' lines. This remains undiscovered until we commit the code, at which point the build fails.
Obviously there are several work-arounds for this, but I would really like R# not to keep deleting code which our build needs. It feels that life around the DEBUG define has gotten much harder in the more recent versions of R# - was it always this bad?
I don't actually know what the solution is, other than to analyse everything twice, once with DEBUG defined and once with out, and clearly that's expensive and doesn't scale to any other #defines anyway. But I want to complain, regardless. :-)