谁副本的app.config到app.exe.config? [英] Who copies app.config to app.exe.config?

查看:218
本文介绍了谁副本的app.config到app.exe.config?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写,创建和编译.NET项目(这是我一直工作在过去的几年里)和我在更新它生成的输出不仅适用于Windows / Visual Studio的过程中游戏开发的IDE ,同时也为Linux / MonoDevelop的(一个简单的惊险过程。NET,但仍需要一些调整)。

I'm writing a game development IDE that creates and compiles .NET projects (which I've been working on for the past few years) and am in the process of updating it to generate output not only for Windows/Visual Studio, but also for Linux/MonoDevelop (a thrillingly simple process for .NET, but still requiring some tweaks).

作为其中的一部分,我认为有必要开始生成一个app.config文件作为这项工作的一部分映射相关的DLL名称Linux的相关性名称以< dllmap>元素。我感到困惑的是谁的责任复制app.config文件的输出名称app.exe.config。在Visual Studio项目,为的app.config生成操作,似乎通常设置为无,其设置指示,它不会在任何地方复制,但是当Visual Studio中编译项目它产生app.exe.config(虽然我有时会发现这是不可靠的)。当我使用的MSBuild建立由IDE(用于调试目的)产生的解决方案文件的MSBuild复制的app.config到app.exe.config。但是,当我编译CSHARP codeProvider.CompileAssemblyFromFile它(​​自然)本项目不喜欢的配置文件被列为源$ C ​​$ C(App.config中(1,1):错误CS0116:命名空间呢不直接包含的成员,如字段或方法),当然它不会将其复制到输出的时候,我不把它作为一个输入。这是我的责任简单地复制的app.config独立app.exe.config,还是有这样做的更标准的方式?

As part of this, I have found it necessary to start generating an app.config file as part of this to map dependent DLL names to Linux dependency names with <dllmap> elements. I'm confused about who's responsible for copying the app.config file to the output name app.exe.config. In a Visual Studio project, the Build Action for app.config seems to normally be set to "None" and its settings indicate that it won't be copied anywhere, yet when Visual Studio compiles the project it generates app.exe.config (though I've sometimes found this to be unreliable). When I use MSBuild to build a solution file generated by the IDE (for debugging purposes), MSBuild copies app.config to app.exe.config. But when I compile the project with CSharpCodeProvider.CompileAssemblyFromFile it (naturally) doesn't like the config file being included as source code ("app.config(1,1) : error CS0116: A namespace does not directly contain members such as fields or methods"), and of course it doesn't copy it to the output when I don't include it as an input. Is it my responsibility to simply copy app.config to app.exe.config independently, or is there a more standard way of doing this?

难道是硬连接到采取的第一个* config文件?在我的IDE这是可以想象的app.config文件将会被重命名或另一个增加(就像在Visual Studio)。这似乎很奇怪,我的IDE拥有这个秘密行动的配置文件(我认为MonoDevelop的行为类似于在这方面,因为我无法找到配置文件专项行动有其一)。我不知道它甚至如何挑选到什么文件这个秘密行动适用。

Is it hardwired to take the first *.config file? In my IDE it's conceivable that the app.config file would be renamed or another one added (just as in Visual Studio). It seems odd to me that the IDE has this secret action for config files (I think MonoDevelop behaves similarly in this regard because I couldn't find a special action for config files there either). I don't know how it even picks to what files this secret action applies.

推荐答案

C#编译器不关心配置文件在所有。构建环境(的MSBuild和VS)将采取复制该文件自理。

The C# compiler does not care about the config file at all. Build environments (MSBuild and VS) will take care of copying that file themselves.

这篇关于谁副本的app.config到app.exe.config?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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