Visual Studio - How to remove a reference in Release mode

后端 未结 5 2274
谎友^
谎友^ 2021-02-12 15:02

I\'m developing a library for use in other apps and this library has lots of debugging and logging statements thanks to NLog.

Is it possible to exclude the reference to

5条回答
  •  旧巷少年郎
    2021-02-12 15:52

    I can't think of a good way to do this. Unless maybe you wrote a stub reference for NLog.dll. Since you are using the reference in your code I don't see how you could just remove it in your release.

    Probably too late now but in the future you could write a class to wrap NLog.dll and then just change it in one place so it wouldn't actually log in the release version. Or have some sort of flag.

提交回复
热议问题