I have a short C# script that uses various features of the languages and different .NET libraries:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Net;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Text;
using System.Threading;
using Microsoft.Win32.SafeHandles;
The full script can be found here.
I compile it with this command:
%WINDIR%\Microsoft.NET\Framework\v3.5\csc.exe code.cs /debug /nologo
But it turns out that .NET Framework v3.5 is not available on some distributions of Windows by default.
What would be the best way to compile this code so it runs on Windows Vista, 7, 8, 8.1 and Server 2008 without a need to download and install the .NET framework?
I tried looking for
%WINDIR%\Microsoft.NET\Framework\v3.0\csc.exe
binary, but it doesn't exist on my machine.