1

Hello all, We are creating a dll on the fly for security, we are attempting to have a dll generated and pushed to clients as a challenge response system... with this we are generating 20 variables each with a unique guid and then programatically selecting which one is referenced in the code... however once it compiles this it no longer has the extra dummy variables in it, just the one that it used.

Does anyone know what i can change in the compiler options to make it stop doing this or trick it into no optimizing those out?

I've tried

U = "71d41342-e56e-4643-b12f-24df0b4506ae";
System.Diagnostics.Debug.WriteLine(U);
string V = "";

referencing it in debug writeline but that didnt seem to be enough to get it to keep it. i also added /Od to disablke optimizations but this didnt seem to help either! Any help would be appreciated

1
  • 1
    try putting static const string in front of your declaration. Commented Sep 19, 2011 at 3:19

1 Answer 1

1

You have several options to achieve that:

  • add those variables to a Dictionary in a consturctor and provide a method to iterate that Dictionary
    OR
  • try putting static reaonly string in front of that declarations
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.