I'm very new to .NET world, I have a small console project (really small) that basically just reference an .DLL created in delphi (where most of the important code is), on my C# code I just have loops, thread sleep instructions and things like that.
My customers is using Microsoft Windows XP SP2, Microsoft XP SP3, Microsoft Windows Vista and Microsoft 7. I want to generate the .EXE in a way to run on all these environments. On my development environment with C# 2010 I have .NET framework 4.0, but I guess that some desktops at my customer has frameworks 3.5 and maybe older. Based on this situation, what is the best option to create the most portable EXE among new and old versions of .NET?
Detailed answer is very welcome since I'm beginner.
Since it may be my simple code, I'm pasting it here.
using System;
using System.Reflection;
using System.Threading;
using System.Web;
using System.Diagnostics;
using Redemption;
namespace test{
class Program
{
static void Main(string[] args)
{
RedemptionLoader.DllLocation64Bit = @"redemption64.dll";
RedemptionLoader.DllLocation32Bit = @"redemption.dll";
var ToEmailAddress = args[0];
var subject = args[1];
var pathFileAttach = args[2];
SendMail(ToEmailAddress, subject, pathFileAttach);
}
private static void SendMail(string ToMail,string subject,string filePath)
{
var session = new RDOSession();
try
{
session.Logon();
if (session.LoggedOn)
{
var Drafts = session.GetDefaultFolder(rdoDefaultFolders.olFolderDrafts);
RDOMail msg = Drafts.Items.Add("IPM.Note");
var body = "Test Redemption.";
msg.To = ToMail;
msg.Recipients.ResolveAll();
msg.Subject = subject;
msg.Body = body;
msg.Attachments.Add(filePath);
msg.Save();
msg.Send();
System.Threading.Thread.Sleep(5000);
}
}
finally
{
session.Logoff();
session = null;
}
}
}
}