1  using System;
2  using System.Diagnostics;
3  using System.IO;
4  using System.Security;
5  using System.Runtime.InteropServices;
6  using MS.StrongName.Native;
7  
8  namespace MS.StrongName
9  {
10      /// <summary>
11      ///     General-purpose utility methods for use throughout
12      /// </summary>
13      internal static class Utility
14      {
15          /// <summary>
16          ///     Get an error message for the last error in the SNAPI
17          /// </summary>
18          /// <returns>Error message</returns>
19          internal static string GetLastStrongNameError()
20          {
21              Exception error = Marshal.GetExceptionForHR(NativeMethods.StrongNameErrorInfo());
22              Debug.Assert(error != null, "No mapping between strong name error info, and HRESULT");
23              return error.Message;
24          }
25      }
26  }