diff --git a/src/Features/Core/Portable/FeaturesResources.resx b/src/Features/Core/Portable/FeaturesResources.resx
index 8cdb883c88f3a..341a1e6399a03 100644
--- a/src/Features/Core/Portable/FeaturesResources.resx
+++ b/src/Features/Core/Portable/FeaturesResources.resx
@@ -3189,4 +3189,7 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
<interface name>
+
+ Unable to create '{0}'
+
\ No newline at end of file
diff --git a/src/Features/Core/Portable/MetadataAsSource/DecompilationMetadataAsSourceFileProvider.cs b/src/Features/Core/Portable/MetadataAsSource/DecompilationMetadataAsSourceFileProvider.cs
index b01c28896a082..2a5a3aac8cb25 100644
--- a/src/Features/Core/Portable/MetadataAsSource/DecompilationMetadataAsSourceFileProvider.cs
+++ b/src/Features/Core/Portable/MetadataAsSource/DecompilationMetadataAsSourceFileProvider.cs
@@ -15,7 +15,6 @@
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.DecompiledSource;
using Microsoft.CodeAnalysis.ErrorReporting;
-using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.PdbSourceDocument;
@@ -171,34 +170,26 @@ internal sealed class DecompilationMetadataAsSourceFileProvider(IImplementationA
var timeout = TimeSpan.FromSeconds(5);
var firstAttempt = true;
var skipWritingFile = false;
- while (!Directory.Exists(directoryToCreate))
+
+ while (!IOUtilities.PerformIO(() => Directory.Exists(directoryToCreate)))
{
- if (stopwatch.Elapsed > TimeSpan.FromSeconds(5))
+ if (stopwatch.Elapsed > timeout)
{
// If we still can't create the folder after 5 seconds, assume we will not be able to create it.
skipWritingFile = true;
break;
}
- try
+ if (firstAttempt)
{
- if (firstAttempt)
- {
- firstAttempt = false;
- }
- else
- {
- await Task.Delay(DelayTimeSpan.Short, cancellationToken).ConfigureAwait(false);
- }
-
- Directory.CreateDirectory(directoryToCreate);
+ firstAttempt = false;
}
- catch (DirectoryNotFoundException)
- {
- }
- catch (UnauthorizedAccessException)
+ else
{
+ await Task.Delay(DelayTimeSpan.Short, cancellationToken).ConfigureAwait(false);
}
+
+ IOUtilities.PerformIO(() => Directory.CreateDirectory(directoryToCreate));
}
if (!skipWritingFile)
diff --git a/src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentMetadataAsSourceFileProvider.cs b/src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentMetadataAsSourceFileProvider.cs
index 1d9e89b352cd7..5c47785d67d55 100644
--- a/src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentMetadataAsSourceFileProvider.cs
+++ b/src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentMetadataAsSourceFileProvider.cs
@@ -14,6 +14,7 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.ErrorReporting;
using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
@@ -178,9 +179,11 @@ internal sealed class PdbSourceDocumentMetadataAsSourceFileProvider(
ImmutableDictionary pdbCompilationOptions;
ImmutableArray sourceDocuments;
- // We know we have a DLL, call and see if we can find metadata readers for it, and for the PDB (whereever it may be)
- using (var documentDebugInfoReader = await _pdbFileLocatorService.GetDocumentDebugInfoReaderAsync(dllPath, options.AlwaysUseDefaultSymbolServers, telemetryMessage, cancellationToken).ConfigureAwait(false))
+
+ try
{
+ // We know we have a DLL, call and see if we can find metadata readers for it, and for the PDB (wherever it may be)
+ using var documentDebugInfoReader = await _pdbFileLocatorService.GetDocumentDebugInfoReaderAsync(dllPath, options.AlwaysUseDefaultSymbolServers, telemetryMessage, cancellationToken).ConfigureAwait(false);
if (documentDebugInfoReader is null)
return null;
@@ -191,11 +194,17 @@ internal sealed class PdbSourceDocumentMetadataAsSourceFileProvider(
// Try to find some actual document information from the PDB
sourceDocuments = documentDebugInfoReader.FindSourceDocuments(handle);
- if (sourceDocuments.Length == 0)
- {
- _logger?.Log(FeaturesResources.No_source_document_info_found_in_PDB);
- return null;
- }
+ }
+ catch (BadImageFormatException ex) when (FatalError.ReportAndCatch(ex))
+ {
+ _logger?.Log(ex.Message);
+ return null;
+ }
+
+ if (sourceDocuments.Length == 0)
+ {
+ _logger?.Log(FeaturesResources.No_source_document_info_found_in_PDB);
+ return null;
}
Encoding? defaultEncoding = null;
@@ -227,6 +236,7 @@ internal sealed class PdbSourceDocumentMetadataAsSourceFileProvider(
}
var tempFilePath = Path.Combine(tempPath, projectId.Id.ToString());
+
// Create the directory. It's possible a parallel deletion is happening in another process, so we may have
// to retry this a few times.
var loopCount = 0;
@@ -234,7 +244,10 @@ internal sealed class PdbSourceDocumentMetadataAsSourceFileProvider(
{
// Protect against infinite loops.
if (loopCount++ > 10)
+ {
+ _logger?.Log(FeaturesResources.Unable_to_create_0, tempFilePath);
return null;
+ }
IOUtilities.PerformIO(() => Directory.CreateDirectory(tempFilePath));
}
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf
index d76a045fe4545..05d48b0bea1c9 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf
@@ -2740,6 +2740,11 @@ Pozitivní kontrolní výrazy zpětného vyhledávání s nulovou délkou se obv
Není možné přečíst zdrojový soubor {0} nebo soubor PDB sestavený pro projekt, který tyto soubory obsahuje. Případné změny provedené v tomto souboru během ladění se nepoužijí, dokud se jeho obsah nebude shodovat se sestaveným zdrojem.
+
+ Unable to create '{0}'
+ Unable to create '{0}'
+
+ Unable to load type '{0}': '{1}'Nejde načíst typ {0}: {1}
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf
index 3228c95e3478d..dd2210ef3894b 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf
@@ -2740,6 +2740,11 @@ Positive Lookbehindassertionen mit Nullbreite werden normalerweise am Anfang reg
Die Quelldatei "{0}" oder die für das enthaltende Projekt kompilierte PDB-Datei kann nicht gelesen werden. Alle Änderungen, die während des Debuggens an dieser Datei vorgenommen wurden, werden erst angewendet, wenn der Inhalt dem kompilierten Quellcode entspricht.
+
+ Unable to create '{0}'
+ Unable to create '{0}'
+
+ Unable to load type '{0}': '{1}'Der Typ „{0}“ kann nicht geladen werden: {1}
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf
index bf89a90b66b84..a2c274adf719c 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf
@@ -2740,6 +2740,11 @@ Las aserciones de búsqueda retrasada (lookbehind) positivas de ancho cero se us
No se puede leer el archivo de código fuente "{0}" o el PDB compilado para el proyecto que lo contiene. Los cambios realizados en este archivo durante la depuración no se aplicarán hasta que su contenido coincida con el del código fuente compilado.
+
+ Unable to create '{0}'
+ Unable to create '{0}'
+
+ Unable to load type '{0}': '{1}'No se ha podido cargar el tipo "{0}": "{1}"
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf
index 8d97983b81c08..8ad452cc07bda 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf
@@ -2740,6 +2740,11 @@ Les assertions arrière positives de largeur nulle sont généralement utilisée
Impossible de lire le fichier source '{0}' ou le PDB généré pour le projet conteneur. Les changements apportés à ce fichier durant le débogage ne seront pas appliqués tant que son contenu ne correspondra pas à la source générée.
+
+ Unable to create '{0}'
+ Unable to create '{0}'
+
+ Unable to load type '{0}': '{1}'Désolé, nous ne pouvons pas charger le type « {0} » – « {1} »
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf
index f7b6323ea0e65..898ec652c325d 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf
@@ -2740,6 +2740,11 @@ Le asserzioni lookbehind positive di larghezza zero vengono usate in genere all'
Non è possibile leggere il file di origine '{0}' o il file PDB compilato per il progetto contenitore. Tutte le modifiche apportate a questo file durante il debug non verranno applicate finché il relativo contenuto non corrisponde al codice sorgente compilato.
+
+ Unable to create '{0}'
+ Unable to create '{0}'
+
+ Unable to load type '{0}': '{1}'Non è possibile caricare il tipo '{0}': '{1}'
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf
index 3f7fd75f1355d..a69c6a61f20a3 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf
@@ -2740,6 +2740,11 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
ソース ファイル '{0}'、またはそれを含むプロジェクト用にビルドされた PDB を読み取れません。デバッグ中にこのファイルに加えられた変更は、そのコンテンツがビルドされたソースと一致するまで適用されません。
+
+ Unable to create '{0}'
+ Unable to create '{0}'
+
+ Unable to load type '{0}': '{1}'次のタグ型を読み込めません '{0}': '{1}'
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf
index 101d88e3705e3..d2d6b992e5016 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf
@@ -2740,6 +2740,11 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
소스 파일 '{0}' 또는 포함하는 프로젝트에 대해 빌드된 PDB를 읽을 수 없습니다. 디버그하는 동안 이 파일의 변경된 모든 내용은 해당 콘텐츠가 빌드된 소스와 일치할 때까지 적용되지 않습니다.
+
+ Unable to create '{0}'
+ Unable to create '{0}'
+
+ Unable to load type '{0}': '{1}'형식 '{0}'을(를) 로드할 수 없음: '{1}'
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf
index 48834942d29b5..280c77a1c60bd 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf
@@ -2740,6 +2740,11 @@ Pozytywne asercje wsteczne o zerowej szerokości są zwykle używane na początk
Nie można odczytać pliku źródłowego „{0}” lub pliku PDB skompilowanego dla projektu, w którym jest on zawarty. Wszystkie zmiany wprowadzone w tym pliku podczas debugowania nie zostaną zastosowane do czasu, aż jego zawartość będzie zgodna ze skompilowanym źródłem.
+
+ Unable to create '{0}'
+ Unable to create '{0}'
+
+ Unable to load type '{0}': '{1}'Nie można załadować typu „{0}”: „{1}”.
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf
index 8cae9d3a63501..3cb31e2b24a31 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf
@@ -2740,6 +2740,11 @@ As declarações de lookbehind positivas de largura zero normalmente são usadas
Não é possível ler o arquivo de origem '{0}' ou o PDB criado para o projeto que o contém. Todas as alterações feitas neste arquivo durante a depuração não serão aplicadas até que o conteúdo corresponda ao código-fonte compilado.
+
+ Unable to create '{0}'
+ Unable to create '{0}'
+
+ Unable to load type '{0}': '{1}'Não foi possível carregar o tipo '{0}': '{1}'
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf
index ebed9650dbb63..7e21da7e18e80 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf
@@ -2740,6 +2740,11 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
Не удалось считать исходный файл "{0}" или PDB, созданный для содержащего проекта. Все изменения, внесенные в этот файл во время отладки, не будут применены, пока содержимое файла не будет соответствовать созданному источнику.
+
+ Unable to create '{0}'
+ Unable to create '{0}'
+
+ Unable to load type '{0}': '{1}'Не удалось загрузить тип "{0}": "{1}"
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf
index cf8a6a16109eb..4a3149c97bb4b 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf
@@ -2740,6 +2740,11 @@ Sıfır genişlikli pozitif geri yönlü onaylamalar genellikle normal ifadeleri
'{0}' kaynak dosyası veya içeren proje için oluşturulan PDB okunamıyor. Hata ayıklama sırasında bu dosyada yapılan değişiklikler, dosyanın içeriği oluşturulan kaynakla eşleşene kadar uygulanmaz.
+
+ Unable to create '{0}'
+ Unable to create '{0}'
+
+ Unable to load type '{0}': '{1}''{0}' türü yüklenemiyor: '{1}'
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf
index 2ff15528e1384..27f0ec9550818 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf
@@ -2740,6 +2740,11 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
无法读取源文件 "{0}" 或为包含项目生成的 PDB。在调试期间对此文件所做的任何更改都不会应用,直到其内容与生成的源匹配为止。
+
+ Unable to create '{0}'
+ Unable to create '{0}'
+
+ Unable to load type '{0}': '{1}'无法加载类型“{0}”:“{1}”
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf
index 4bb05745d9295..2338867474297 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf
@@ -2740,6 +2740,11 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
無法讀取來源檔案 '{0}' 或為包含該檔案之專案所建置的 PDB。等到此檔案的內容與已建置的來源一致後,才會套用於偵錯期間對此檔案所做的所有變更。
+
+ Unable to create '{0}'
+ Unable to create '{0}'
+
+ Unable to load type '{0}': '{1}'無法載入類型 '{0}': '{1}'