How do I prevent the app.config from being integrated into a .net Library (dll)

后端 未结 3 1138
猫巷女王i
猫巷女王i 2021-01-20 03:03

When I compile the library, all the settings in Settings.Settings are integrated into the DLL. how do I prevent this?

相关标签:
3条回答
  • 2021-01-20 03:42

    Don't have any settings listed in Settings.Settings. If you don't want them being shipped out in the dll, then don't have them. If you have them, then you must need them for something, in which case it makes no sense not to include them.

    0 讨论(0)
  • 2021-01-20 03:51

    If you don't want to expose values, make sure you have an app.config with deployment values (empty, 0, or something). The values WILL be compiled into the DLL as default values.

    0 讨论(0)
  • 2021-01-20 04:01

    View the properties of the Settings.settings file and set the Build Action to Resource, Copy to Output Directory to Do Not Copy.

    This should create you a dll.config file where you can edit the settings outside of building.

    0 讨论(0)
提交回复
热议问题