I have C++ project (VS2005) which includes header file with version number in #define directive. Now I need to include exactly the same number in twin C# project. What is th
You could always use the pre-build event to run the C preprocessor on the .cs file and the post build event to undo the pre-build step. The preprocessor is just a text-substitution system, so this is possible:
// version header file
#define Version "1.01"
// C# code
#include "version.h"
// somewhere in a class
string version = Version;
and the preprocessor will generate:
// C# code
// somewhere in a class
string version = "1.01";