I am very new to the .NET world, I have a small console project (very small) that basically just refers to the .DLL created in delphi (where most of the important code is), on my C # code, which I have cycles, sleep shutdown instructions, etc.
My clients use Microsoft Windows XP SP2, Microsoft XP SP3, Microsoft Windows Vista, and Microsoft 7. I want to create .EXE so that it works in all of these environments. In my development environment with C # 2010, I have the .NET framework 4.0, but I think some desktop computers have my client frames 3.5 and possibly older. Based on this situation, what is the best option for creating the most portable EXE among new and old versions of .NET?
A detailed answer is very welcome as I begin.
Since this may be my simple code, I insert 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; } } } }
source share