I write a small application, that I don't need store anything in config files. So the file App.config
in my source is exactly what ever Visual Studio has created.
So I want to delete this file from source code (before compiling). But I noticed that it also contains the .NET version information. I wonder if I delete App.config
file, then copy my application to other pc, is it have any strange behavior?
If someone deletes the . config file, it's gone, baby, gone. And it will be necessary to create, deploy, or GET it again. Storing values of default settings - probably two obvious answers would be in a config file or a database table.
Also deleting the configuration files wont do you any harm except when mods suddenly change thier Block/Item Id's and you load an old World with the old Id's blocks might be missing, also beware when using Optifine that you dont delete the "optionsof.
config are only required, if you have coded your application in such a way that it is explicitly dependent on it. If you have not done this, or have put error handling/default values or actions in place where it can't read the config file, one would assume your application could run without it.
App. Config is an XML file that is used as a configuration file for your application. In other words, you store inside it any setting that you may want to change without having to change code (and recompiling). It is often used to store connection strings.
I wonder if I delete App.config file, then copy my application to other pc, is it have any strange behavior?
Nope, it should be fine. There are various (somewhat tortuous) rules about exactly what version of the CLR etc gets used in what situations, but for the most part you're fine to just rely on the default behaviour.
You really don't need an app.config
file unless you need to give specific settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With