VOS.NoWhere

  • Topic
  • Discussion
  • VOS.NoWhere(Last) -- DAVWikiAdmin? , 2017-06-13 05:47:52 Edit WebDAV System Administrator 2017-06-13 05:47:52

    How to use visual studio command prompt to compile .Net source codes (e.g. cs files and reference to DLL files)

    There are different commands parameter that could be used to compile Csharp files onto different application execution types i.e. the most common one which is mostly available for users online are

    CSC /out:execution file_name *.cs / reference:dll_name

    OR

    CSC *.cs / reference:dll_name

    It is not a good practice to use the any of the commands parameter above to compile Csharp Source codes for example if you use the any of the above commands parameter to compile cs file onto Winform Execution file thus the compiler should compile successfully and generate winform execution but you most likely to come across some issues such as Console Application display at the background which is totally not required.

    To resolve or prevent this issue hence it is better to use this command parameter given below to indicate to the compiler the type of execution to compile to .e.g. you have Console Application Execution and Winform Execution.

    CSC /out:execution file_name /target:winexe *.cs / reference:dll_name

    /target: is used for:

    /target:exe Build a console executable (default) (Short form: /t:exe)

    /target:winexe Build a Windows executable (Short form: /t:winexe)

    /target:library Build a library (Short form: /t:library)

    /target:module Build a module that can be added to another

    /out: is used for:

    /out: Specify output file name (default: base name of file with main class or

    first file)

    *.cs is used for including all the Csharp Source Code files to be compiled the same default directory path.

    /reference: is used for referencing metadata from the specified assembly

    files (Short form: /r)

    To know more about CSC compiler settings, type csc /? on Visual Studio 2005 Command Prompt.