Example #1
0
        string GetHostInfo()
        {
            var hostInfo = new HostInfo
            {
                PackageRoot      = PackageRoot,
                RuntimeRoot      = RuntimeRoot,
                UserLibraryPath  = UserLibraryPath.Replace("\\", "/"),
                ProxyLibraryPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ClrBridge.dll").Replace("\\", "/"),
            };
            var jsc = new DataContractJsonSerializer(typeof(HostInfo));

            using (var ms = new MemoryStream())
            {
                jsc.WriteObject(ms, hostInfo);
                ms.Position = 0;
                return(new StreamReader(ms).ReadToEnd());
            }
        }
Example #2
0
 string GetHostInfo()
 {
     var hostInfo = new HostInfo
     {
         PackageRoot = PackageRoot,
         RuntimeRoot = RuntimeRoot,
         UserLibraryPath = UserLibraryPath.Replace("\\", "/"),
         ProxyLibraryPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ClrBridge.dll").Replace("\\", "/"),
     };
     var jsc = new DataContractJsonSerializer(typeof(HostInfo));
     using (var ms = new MemoryStream())
     {
         jsc.WriteObject(ms, hostInfo);
         ms.Position = 0;
         return new StreamReader(ms).ReadToEnd();
     }
 }