-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Ported from TFS WorkItem: 1116649
Repro Steps:
- Create project that references CTP 5 nuget packages (beta2)
- Upgrade packages in project from Beta2 to 1.0-rc1
- Build project
Expected:
Project build successfully
Actual:
We are unable to find the resource file for Microsoft.CodeAnalysis.Analyzers and crash the compiler process.
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis.Analyzers.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. ---> System.IO.FileNotFoundException: Could not find file 'C:\StyleCopAnalyzers\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0-rc1\tools\analyzers\Microsoft.CodeAnalysis.Analyzers.resources.dll'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.File.InternalReadAllBytes(String path, Boolean checkHost)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.InMemoryAssemblyLoader.LoadCore(String fullPath)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerFileReference.InMemoryAssemblyLoader.CurrentDomain_AssemblyResolve(Object sender, ResolveEventArgs args)
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
--- End of inner exception stack trace ---
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at Microsoft.CodeAnalysis.LocalizableResourceString.ToString(IFormatProvider formatProvider)
at Microsoft.CodeAnalysis.DiagnosticFormatter.Format(Diagnostic diagnostic, IFormatProvider formatter)
at Microsoft.CodeAnalysis.CommonCompiler.PrintErrors(IEnumerable`1 diagnostics, TextWriter consoleOutput)
at Microsoft.CodeAnalysis.CommonCompiler.RunCore(TextWriter consoleOutput, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CommonCompiler.Run(TextWriter consoleOutput, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.CSharpCompiler.Run(TextWriter consoleOutput, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.CommandLine.Csc.Run(String[] args)
at Microsoft.CodeAnalysis.CSharp.CommandLine.Program.Main(String[] args)
Revisions:
- Created By Jonathon Marolf (1/28/2015 6:43:07 PM)
Even if we can't find a resource for the analyzer we shouldn't crash the process. We should handle this exception.
- Edited By Srivatsn Narayanan (1/29/2015 11:46:45 AM)
Is this the old FallbackResourceLocation bug again?