Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

[Pre-release] EASY C# COMPILER WRAPPER

I've written this thread twice now and Microsoft Edge browser removed my text and backed me out. Needless to say jimmies have been rustled, so I'll populate this with information later. New versions of this compiler wrapper will be posted in this thread. If not in the OP, then in a reply.

Usage

Code
    class Program
    {
        static void Main(string[] args)
        {
            var compiler = new Compiler();
            var settings = new CompilerSettings("Stub");

            // populate settings
            settings.AddSource(Properties.Resources.source);
            settings.BuildMode = BuildMode.Release;
            settings.BuildType = BuildType.Console;

            // compile
            var result = compiler.Compile(settings, "outputAssembly.exe");

            // display result to user (built-in!)
            compiler.DisplayResult(result);
        }
    }


Features
  • Easy to use properties (even for beginners)
  • Easily add resources from byte[], stream, or filename
  • Built-in result prompt, asks if you want to open the output directory
Download
[Image: Syr3DlV.png]
I built a tool like this a few years back too which was pretty basic but flexible for changing the .NET version and such. It was a useful tool for when you don't have a C# compiler to work with, and don't have internet to use online compilers.
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
What if the compilation returns errors? How will those errors be handled?
It returns the .NET framework CompilerResults from https://msdn.microsoft.com/en-us/library....110).aspx
[Image: Syr3DlV.png]
(Oct 27, 2017 06:36 PM)gigajew Wrote:  It returns the .NET framework CompilerResults from https://msdn.microsoft.com/en-us/library....110).aspx

Ah, that makes sense. I have no experience with CodeDom in the slightest hence I asked.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by NullSystemDec 2, 2019 08:43 AM 1 235 Dec 2, 2019 08:43 AM
Last Post: HFDone
[C#] by JUSTINJun 8, 2019 07:39 PM 28 979 Jun 8, 2019 07:39 PM
Last Post: doxerhacker
[Python] by VassiliosMar 30, 2019 07:33 AM 3 193 Mar 30, 2019 07:33 AM
Last Post: authorSS