Compiling a project on the command line can be done using the Microsoft Build Engine or using batch files, although the first method involves using.targets files available exclusively in Visual Studio. Both compilation methods are based on the use of the Visual Basic and Visual C # compilers.
Make sure you have the required MSBuild executable file in the% systemroot% Microsoft. NETFramework version_name folder and check that the system path variable matches the specified directory. Specify the directory containing the files of the required project in the command interpreter and make sure that one of the extensions is used: - csproj; - sln; - vbproj Enter the value msbuild.exe name of the project to be compiled into the command line test field and check the displayed data for the selected process.
Use batch files to define the path variables that point to the. NET Compact Framework assembly to use, the required references, and the compiler command syntax. Use any text editor to create a new file and add the generated batch file to it. If necessary, change the value of the path variable and save the created document with an arbitrary name and a.bat extension.
Make sure the path variable contains the. NET Framework directory that contains the required csc.ee and vbc.exe executables, which are both the Visual C # and Visual Basic compilers. Enter the value for the name of the generated batch and source files in the command interpreter text box. Please note that the extension of the source file must match the compiler being used.
Use the necessary compiler parameter values: - r - to set the required assembly references; - imports - to import the required namespaces; - nostdlb - to determine the required assembly omissions (for Visual C #); - netcf - to determine the required assembly omissions (for Visual Basic); - noconfig - required parameter; - sdkpath - to determine the location of the Mscorlib.dll library.