Build exe dynamically
-
:( hi, I have a big problem in building deffrent mode of my application, imagine that we have a project contans of 3 part, for example a,b,c.In part a some codes of b and c must not be compiled in compile time, for this i used #define preproc and now, i need to compile full project by defining a, b or c there is a command which is csc.exe /define:[a|b|c] but this command only compiles one file and make exe. Now is there any way to compile a project with defining ? of course not changing source codes!my project considers 1000 source files :doh:
-
:( hi, I have a big problem in building deffrent mode of my application, imagine that we have a project contans of 3 part, for example a,b,c.In part a some codes of b and c must not be compiled in compile time, for this i used #define preproc and now, i need to compile full project by defining a, b or c there is a command which is csc.exe /define:[a|b|c] but this command only compiles one file and make exe. Now is there any way to compile a project with defining ? of course not changing source codes!my project considers 1000 source files :doh:
Don't post the same question in the forums and QA - it duplicates work and annoys people.
Did you know: That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
-
:( hi, I have a big problem in building deffrent mode of my application, imagine that we have a project contans of 3 part, for example a,b,c.In part a some codes of b and c must not be compiled in compile time, for this i used #define preproc and now, i need to compile full project by defining a, b or c there is a command which is csc.exe /define:[a|b|c] but this command only compiles one file and make exe. Now is there any way to compile a project with defining ? of course not changing source codes!my project considers 1000 source files :doh:
You should take a closer look on MSBuild!
-
You should take a closer look on MSBuild!
-
You can execute the following command to use your specific #define variable. For example:
msbuild /t:Rebuild /p:Configuration=Release /p:DefineConstants=YourDefineStatement YourSolution.sln
This will rebuild the specified solution. It will result in a release build with the YourDefineStatement specified as preprocessor define statement.
WM. My blog
-
:( hi, I have a big problem in building deffrent mode of my application, imagine that we have a project contans of 3 part, for example a,b,c.In part a some codes of b and c must not be compiled in compile time, for this i used #define preproc and now, i need to compile full project by defining a, b or c there is a command which is csc.exe /define:[a|b|c] but this command only compiles one file and make exe. Now is there any way to compile a project with defining ? of course not changing source codes!my project considers 1000 source files :doh:
kasraa00098000 wrote:
but this command only compiles one file and make exe
No, you can compile multiple files or produce a DLL. CSC is called by Visual Studio, so it can compile and produce anything VS can.
-
kasraa00098000 wrote:
but this command only compiles one file and make exe
No, you can compile multiple files or produce a DLL. CSC is called by Visual Studio, so it can compile and produce anything VS can.
really? how can I compile a csproj file with csc? what about a group of cs file?