public static string CurrentDomainPaths() { #if NET461 return(Environment.Version.ToString() + "\r\n" + Assembly.GetExecutingAssembly().CodeBase + "\r\n" + "ApplicationBase: " + AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "\r\n" + "PrivateBinPath: " + AppDomain.CurrentDomain.SetupInformation.PrivateBinPath + "\r\n" + "PrivateBinProbe: " + AppDomain.CurrentDomain.SetupInformation.PrivateBinPathProbe + "\r\n" + Directory.GetCurrentDirectory() + "\r\n" + AppDomain.CurrentDomain.FriendlyName + "\r\n"); #else return(TraceOutputHelper.LineWithTrace("Supported only NETStandard 2.0+ ")); #endif // NET461 }
// Methods public static void LogToFile(Exception exc, string path, bool append) { var file = File.Open(path, FileMode.Append); StreamWriter writer1 = new StreamWriter(file) { AutoFlush = true }; //StreamWriter(path, append); Debug.WriteLine(exc.ToString()); writer1.WriteLine(TraceOutputHelper.LineWithTrace(DateTime.Now.ToString())); writer1.WriteLine(TraceOutputHelper.LineWithTrace(exc.ToString())); writer1.Dispose(); //return text1; }
public static void TracedLine(string format, params object[] arg) { string sRet = TraceOutputHelper.LineWithTrace(format, arg); Debug.WriteLine(sRet); }
public static void TracedLine(string sComment) { string sRet = TraceOutputHelper.LineWithTrace(sComment); Debug.WriteLine(sRet); }