简体   繁体   中英

Always running #if debug in dll

I have a property in config named to class like the following in my framework project:

public static string PropertyName
{
    get
    {
      #if DEBUG
          return GetValue("TestDevelopment");
      #else
          return GetValue("Test");
      #endif
    }
}

I've compiled my project. And I added this config.dll file to different project. But always returning GetValue("TestDevelopment") from this dll. I 've compiled Release mode but it's not working.

What's the problem to be? I hope, could tell...

If you compiled the dll as debug, and copied the file to a different one, it'll always be whatever it was when you compiled it.

You'll have to compile it in Release for it to be in release.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM