如果我在C#应用程序中删除App.config会发生什么? [英] What happen if I delete App.config in C# application?

查看:280
本文介绍了如果我在C#应用程序中删除App.config会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个小应用程序,不需要在配置文件中存储任何内容.因此,源文件中的文件App.config正是Visual Studio创建的文件.
因此,我想从源代码中删除此文件(在编译之前).但是我注意到它还包含.NET版本信息.我想知道是否删除App.config文件,然后将我的应用程序复制到另一台PC,它是否有任何奇怪的行为?

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?

推荐答案

我想知道是否删除App.config文件,然后将我的应用程序复制到另一台PC,它是否有任何奇怪的行为?

I wonder if I delete App.config file, then copy my application to other pc, is it have any strange behavior?

不,应该没问题.关于在什么情况下使用什么版本的CLR等有各种(有些曲折的)规则,但是在大多数情况下,您可以仅依赖默认行为.

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.

除非您需要进行特定设置,否则您实际上不需要app.config文件.

You really don't need an app.config file unless you need to give specific settings.

这篇关于如果我在C#应用程序中删除App.config会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆