Ejemplo n.º 1
0
        private IReadOnlyList <AssemblyDebugSourceDocument> GetSourceDocuments()
        {
            var list = new List <AssemblyDebugSourceDocument>();

            foreach (var docHandle in _reader.Documents)
            {
                var document = _reader.GetDocument(docHandle);

                var langGuid = _reader.GetGuid(document.Language);
                var hashGuid = _reader.GetGuid(document.HashAlgorithm);
                var docName  = _reader.GetString(document.Name).Replace(@"\", @"/"); // use forward slashes for the url

                try
                {
                    var doc = new AssemblyDebugSourceDocument
                              (
                        docName,
                        _reader.GetBlobBytes(document.Hash),
                        langGuid,
                        hashGuid
                              );
                    list.Add(doc);
                }
                catch (ArgumentOutOfRangeException ex)
                {
                    DiagnosticsClient.TrackException(ex, new Dictionary <string, string>
                    {
                        { "LanguageGuid", langGuid.ToString() },
        private IEnumerable <AssemblyDebugSourceDocument> GetSourceDocuments()
        {
            foreach (var dh in _reader.Documents)
            {
                if (dh.IsNil)
                {
                    continue;
                }
                var d = _reader.GetDocument(dh);
                if (d.Name.IsNil || d.Language.IsNil || d.HashAlgorithm.IsNil || d.Hash.IsNil)
                {
                    continue;
                }

                var name          = _reader.GetString(d.Name);
                var language      = _reader.GetGuid(d.Language);
                var hashAlgorithm = _reader.GetGuid(d.HashAlgorithm);
                var hash          = _reader.GetBlobBytes(d.Hash);
                var isEmbedded    = IsEmbedded(dh);


                var doc = new AssemblyDebugSourceDocument
                          (
                    name,
                    hash,
                    language,
                    hashAlgorithm,
                    isEmbedded
                          );

                if (doc.Language == SymbolLanguage.Unknown)
                {
                    DiagnosticsClient.TrackEvent("Unknown language Guid", new Dictionary <string, string>
                    {
                        { "LanguageGuid", language.ToString() },
        private IReadOnlyList <AssemblyDebugSourceDocument> GetSourceDocuments()
        {
            var list = new List <AssemblyDebugSourceDocument>();

            foreach (var docHandle in _reader.Documents)
            {
                var document = _reader.GetDocument(docHandle);

                var langGuid = _reader.GetGuid(document.Language);
                var hashGuid = _reader.GetGuid(document.HashAlgorithm);
                var docName  = _reader.GetString(document.Name).Replace(@"\", @"/"); // use forward slashes for the url

                var doc = new AssemblyDebugSourceDocument
                          (
                    docName,
                    _reader.GetBlobBytes(document.Hash),
                    langGuid,
                    hashGuid
                          );
                list.Add(doc);

                if (doc.Language == SymbolLanguage.Unknown)
                {
                    DiagnosticsClient.TrackEvent("Unknown language Guid", new Dictionary <string, string>
                    {
                        { "LanguageGuid", langGuid.ToString() },