We have a project compiled into a DLL called consts.dll, which contains something like:
public static class Consts { public const string a = "a"; public const string b = "b"; public const string c = "c"; }
We have several projects of this kind, each of which is compiled into a DLL with the same name (consts.dll), and we replace them as needed. We have another class that uses these constants:
public class ConstsUser { string f() { return Consts.a; } }
Unfortunately, Consts.a optimized for "a", so even if we replace the implementation of Consts.dll, we still get "a" instead of the correct value, and we need to recompile ConstsUser . In any case, so that the optimizer does not replace constant variables with its values?
optimization c #
Shmoopy Jan 09 '14 at 14:21 2014-01-09 14:21
source share