문제

I've added a bunch of files from my older project into my new project. They're still not playing an active role in my current code and there are missing classes that won't make them fully functional anyway, I just want them there so I can gradually rework each file to be compatible with my newest code. Is there a way tell the compiler not to pay attention to these C# files and report errors?

P.S: I'm using SharpDevelop

도움이 되었습니까?

해결책 3

Although it is possible to give specific compiler instruction, I'd remove the files from the solution and put them somewhere safe in version control.

Having these files in the solution can easily be confusing when browsing the sources; I would not expect to have to check the BuildAction property of C# files to find out whether or not I am looking at something that is part of the build.

I read a lot of code in a source control viewer (looking a delta's and history), compiler options are not very obvious in environments like these.

Put them safe in source control and remove them from the build.

다른 팁

Have a look on the File Properties for

BuildAction Property

The BuildAction property indicates what Visual Studio does with a file when a build is executed. BuildAction can have one of several values: • None - The file is not included in the project output group and is not compiled in the build process. An example is a text file that contains documentation, such as a Readme file.

• Compile - The file is compiled into the build output. This setting is used for code files.

• Content - The file is not compiled, but is included in the Content output group. For example, this setting is the default value for an .htm or other kind of Web file.

• Embedded Resource - This file is embedded in the main project build output as a DLL or executable. It is typically used for resource files.

use c# preprocessor directive #if then put that conditional variable inside Compiling/General/Conditional Compiling Symbols http://msdn.microsoft.com/en-us/library/aa691099(v=vs.71).aspx

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top