如何创建复合 .cs 文件 [英] How to create composite .cs file
问题描述
我需要从解决方案 (Visual Studio 2012) 的所有 .cs 文件中创建一个 .cs 文件,以应对某些官僚主义.有没有插件可以帮我解决这个问题?
I need to create one .cs file from all .cs files of the solution(Visual Studio 2012) for some bureaucracy. Is there a plugin that can help me with it?
推荐答案
这在一般意义上是不可能的.考虑这两个文件:
That isn't possible, in a general sense. Consider these two files:
Foo.cs:
#define X
#if Y
#error Bang!
#endif
#if !X
#error Bang!
#endif
class Foo {}
Bar.cs:
#define Y
#if X
#error Bang!
#endif
#if !Y
#error Bang!
#endif
class Bar {}
请注意,#define
和 #undef
必须位于 C# 文件的开头...因此整个文件都使用定义的相同符号集进行处理- 但是您的原始两个文件是使用不同 组定义的符号处理的.
Note that #define
and #undef
have to come at the start of a C# file... so the whole file is processed with the same set of symbols defined - but your original two files were processed with different sets of symbols defined.
我强烈建议您尝试删除该要求.
I would strongly advise you to try to remove the requirement.
这篇关于如何创建复合 .cs 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!