Greetings
I am new to TextPad, programming and to this forum. I would first like to compliment the developer for creating what I have been looking in an editor when I don't need to use Visual Studio. The program is fast, reasonably easy to configure, and has most of the options I am looking for.
Questions:
-I have set up a compiler for C#. Fair enough. How do I go about setting up to compile multiple files into an executable. I am obviously missing something. I suspect it is something simple a newbie would overlook.
-Now that I have abused your good nature, would you give me a quick run through on setting up a debugger either the VS or .NET debugger would be fine.
Thank you in advance for your help. I would like to work through these issues before I purchase the product, given that Helios does not offer refunds.
Thanks again and have a good day.
Compiling Multiple Files C#
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 18
- Joined: Sun Feb 15, 2009 12:50 pm
Re: Compiling Multiple Files C#
HiQuestions:
-I have set up a compiler for C#. Fair enough. How do I go about setting up to compile multiple files into an executable. I am obviously missing something. I suspect it is something simple a newbie would overlook.
I don't know if this is still relevant or whether you are still looking to set up TextPad to build C# assemblies from multiple files, but it might still be helpful to post some pointers just in case anyone else is thinking about doing the same.
If you have set up your compiler - Csc.exe for C# .NET - then you already have the tool setting to achieve what you want. I'm assuming your tool settings are something like: (see correction in next post.)
Code: Select all
Command: C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe
Parameters: $File
Initial Folder: $FileDir
Obviously the level of information you put into a response file depends on the needs of what you are building, but suppose you have only a couple of files - File1.cs and File1.cs - and you want to build them into an assembly called MultipleFiles.exe, then you could put together a response file as:
Code: Select all
# Response file to build MultipleFiles.exe
/out:MultipleFiles.exe
File1.cs
File2.cs
There are many other options that can be set when your needs become greater in terms of what you want to build, and how you want the compiler to process your code. For example:
Code: Select all
#Response file referencing library code in the build
# the assembly that will be built
/out:MultipleFilesUsingLibraryCode.exe
# use optimization
/o
# build with full debug info
/debug:full
# set the compiler warning level to 4
/w:4
# include these files in the build
File1.cs
File2.cs
# and reference these libraries
/reference:Library1.dll,Library2.dll
If you wanted to be even more adventurous, it is even possible to set up TextPad to send Visual Studio project files (*.csproj, *.vbproj) to MSBuild.exe (instead of Csc, for C#) and have your projects reference other projects and build your .exe and .dlls all in the same run, and all manner of wonderful things!
Hope this helps.
-
- Posts: 18
- Joined: Sun Feb 15, 2009 12:50 pm
Re: Compiling Multiple Files C#
Correction!shaqmeister wrote:.Code: Select all
Command: C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe Parameters: $File Initial Folder: $FileDir
Actually, this won't quite work, since in order for Csc to know the distinction between a code file (*.cs) and a response file (*.rsp), the filename needs to be sent to the compiler prefixed with '@'. Thus, the correct usage is:
Code: Select all
Command: C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe
Parameters: @$FileName
Initial Folder: $FileDir
Code: Select all
Command: C:\Windows\Microsoft.NET\Framework\v3.5\vbc.exe
Parameters: @$FileName
Initial Folder: $FileDir
Code: Select all
Command: C:\Windows\Microsoft.NET\Framework\v3.5\vbc.exe
Parameters: /?
Initial Folder:
Capture Output: selected
Code: Select all
Microsoft (R) Visual Basic Compiler version 9.0.30729.1
Copyright (c) Microsoft Corporation. All rights reserved.
Visual Basic Compiler Options
- OUTPUT FILE -
/out:<file> Specifies the output file name.
/target:exe Create a console application (default). (Short form: /t)
/target:winexe Create a Windows application.
/target:library Create a library assembly.
/target:module Create a module that can be added to an assembly.
/doc[+|-] Generates XML documentation file.
/doc:<file> Generates XML documentation file to <file>.
- INPUT FILES -
/addmodule:<file_list> Reference metadata from the specified modules.
/recurse:<wildcard> Include all files in the current directory and subdirectories according to the wildcard specifications.
/reference:<file_list> Reference metadata from the specified assembly. (Short form: /r)
- RESOURCES -
/linkresource:<resinfo> Links the specified file as an external assembly resource. resinfo:<file>[,<name>[,public|private]] (Short form: /linkres)
/nowin32manifest The default manifest should not be embedded in the manifest section of the output PE.
/resource:<resinfo> Adds the specified file as an embedded assembly resource. resinfo:<file>[,<name>[,public|private]] (Short form: /res)
/win32icon:<file> Specifies a Win32 icon file (.ico) for the default Win32 resources.
/win32manifest:<file> The provided file is embedded in the manifest section of the output PE.
/win32resource:<file> Specifies a Win32 resource file (.res).
- CODE GENERATION -
/optimize[+|-] Enable optimizations.
/removeintchecks[+|-] Remove integer checks. Default off.
/debug[+|-] Emit debugging information.
/debug:full Emit full debugging information (default).
/debug:pdbonly Emit PDB file only.
- ERRORS AND WARNINGS -
/nowarn Disable all warnings.
/nowarn:<number_list> Disable a list of individual warnings.
/warnaserror[+|-] Treat all warnings as errors.
/warnaserror[+|-]:<number_list> Treat a list of warnings as errors.
- LANGUAGE -
/define:<symbol_list> Declare global conditional compilation symbol(s). symbol_list:name=value,... (Short form: /d)
/imports:<import_list> Declare global Imports for namespaces in referenced metadata files. import_list:namespace,...
/optionexplicit[+|-] Require explicit declaration of variables.
/optioninfer[+|-] Allow type inference of variables.
/rootnamespace:<string> Specifies the root Namespace for all type declarations.
/optionstrict[+|-] Enforce strict language semantics.
/optionstrict:custom Warn when strict language semantics are not respected.
/optioncompare:binary Specifies binary-style string comparisons. This is the default.
/optioncompare:text Specifies text-style string comparisons.
- MISCELLANEOUS -
/help Display this usage message. (Short form: /?)
/noconfig Do not auto-include VBC.RSP file.
/nologo Do not display compiler copyright banner.
/quiet Quiet output mode.
/verbose Display verbose messages.
- ADVANCED -
/baseaddress:<number> The base address for a library or module (hex).
/bugreport:<file> Create bug report file.
/codepage:<number> Specifies the codepage to use when opening source files.
/delaysign[+|-] Delay-sign the assembly using only the public portion of the strong name key.
/errorreport:<string> Specifies how to handle internal compiler errors; must be prompt, send, none, or queue (default).
/filealign:<number> Specify the alignment used for output file sections.
/keycontainer:<string> Specifies a strong name key container.
/keyfile:<file> Specifies a strong name key file.
/libpath:<path_list> List of directories to search for metadata references. (Semi-colon delimited.)
/main:<class> Specifies the Class or Module that contains Sub Main. It can also be a Class that inherits from System.Windows.Forms.Form. (Short form: /m)
/moduleassemblyname:<string> Name of the assembly which this module will be a part of.
/netcf Target the .NET Compact Framework.
/nostdlib Do not reference standard libraries (system.dll and VBC.RSP file).
/platform:<string> Limit which platforms this code can run on; must be x86, x64, Itanium or anycpu (default).
/sdkpath:<path> Location of the .NET Framework SDK directory (mscorlib.dll).
/utf8output[+|-] Emit compiler output in UTF8 character encoding.
@<file> Insert command-line settings from a text file.
/vbruntime[+|-] Compile with/without the default Visual Basic runtime.
/vbruntime:<file> Compile with the alternate Visual Basic runtime in <file>.