Skip to content

New exceptions thrown for SCS extension after upgrading VS #289

Description

@catherinelpowell

Environment:

  • Version: 5.6.7

  • Installation/Running method:

    • [x ] Visual Studio Extension <!-- Please write the Visual Studio version 17.7.4->. I used the Visual Studio Manage Extensions window to install.
  • Operating System:

    • [x ] Windows

Describe the bug
I use the SCS extension for a .NET website (not webproject i.e. no .vbproj file). Prior to the last Visual Studio upgrade to ver 17.7.4, I was able to view the warnings in the Visual Studio Error list for each web page. After Visual Studio was upgraded I am getting a lot of Security Code Scan exception messages in the Visual Studio Error list instead.

Repro
Here is an example of the multiple SCS exception messages that I see in the Visual Studio Error List window for one of the website pages:
Severity Code Description Project File Line Suppression State
Warning AD0001 Analyzer 'SecurityCodeScan.Analyzers.XxeDiagnosticAnalyzerVisualBasic' threw an exception of type 'System.TypeInitializationException' with message 'The type initializer for 'SecurityCodeScan.Analyzers.XxeDiagnosticAnalyzer' threw an exception.'.
System.TypeInitializationException: The type initializer for 'SecurityCodeScan.Analyzers.XxeDiagnosticAnalyzer' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'. The system cannot find the file specified.
File name: 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'
at SecurityCodeScan.Analyzers.Locale.YamlResourceManager.Load()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.<>c.<.cctor>b__8_0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location --- at System.Lazy1.CreateValue()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetLocalString(String id)
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetDescriptor(String id, String titleId, String descriptionId, DiagnosticSeverity severity, Boolean isEnabledByDefault, String[] args)
at SecurityCodeScan.Analyzers.Taint.LdapFilterTaintAnalyzer..cctor()
--- End of inner exception stack trace ---
at SecurityCodeScan.Analyzers.XxeDiagnosticAnalyzer.get_SupportedDiagnostics()
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerManager.AnalyzerExecutionContext.<>c__DisplayClass21_0.<ComputeDiagnosticDescriptors_NoLock>b__0(Object _)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action1 analyze, TArg argument, Nullable1 info, CancellationToken cancellationToken)

System.IO.FileNotFoundException: Could not load file or assembly 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'. The system cannot find the file specified.
File name: 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'
at SecurityCodeScan.Analyzers.Locale.YamlResourceManager.Load()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.<>c.<.cctor>b__8_0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location --- at System.Lazy1.CreateValue()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetLocalString(String id)
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetDescriptor(String id, String titleId, String descriptionId, DiagnosticSeverity severity, Boolean isEnabledByDefault, String[] args)
at SecurityCodeScan.Analyzers.Taint.LdapFilterTaintAnalyzer..cctor()

Analyzer 'SecurityCodeScan.Analyzers.XxeDiagnosticAnalyzerVisualBasic' threw the following exception:
'System.TypeInitializationException: The type initializer for 'SecurityCodeScan.Analyzers.XxeDiagnosticAnalyzer' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'. The system cannot find the file specified.
File name: 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'
at SecurityCodeScan.Analyzers.Locale.YamlResourceManager.Load()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.<>c.<.cctor>b__8_0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location --- at System.Lazy1.CreateValue()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetLocalString(String id)
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetDescriptor(String id, String titleId, String descriptionId, DiagnosticSeverity severity, Boolean isEnabledByDefault, String[] args)
at SecurityCodeScan.Analyzers.Taint.LdapFilterTaintAnalyzer..cctor()
--- End of inner exception stack trace ---
at SecurityCodeScan.Analyzers.XxeDiagnosticAnalyzer.get_SupportedDiagnostics()
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.CreateDisablingMessage(DiagnosticAnalyzer analyzer, String analyzerName)

System.IO.FileNotFoundException: Could not load file or assembly 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'. The system cannot find the file specified.
File name: 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'
at SecurityCodeScan.Analyzers.Locale.YamlResourceManager.Load()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.<>c.<.cctor>b__8_0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location --- at System.Lazy1.CreateValue()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetLocalString(String id)
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetDescriptor(String id, String titleId, String descriptionId, DiagnosticSeverity severity, Boolean isEnabledByDefault, String[] args)
at SecurityCodeScan.Analyzers.Taint.LdapFilterTaintAnalyzer..cctor()

'. 1_App_Code C:\Workspaces\W2G\W2G.sln 1 Active
Warning AD0001 Analyzer 'SecurityCodeScan.Analyzers.Taint.DeserializationTaintAnalyzer' threw an exception of type 'System.TypeInitializationException' with message 'The type initializer for 'SecurityCodeScan.Analyzers.Taint.DeserializationTaintAnalyzer' threw an exception.'.
System.TypeInitializationException: The type initializer for 'SecurityCodeScan.Analyzers.Taint.DeserializationTaintAnalyzer' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'. The system cannot find the file specified.
File name: 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'
at SecurityCodeScan.Analyzers.Locale.YamlResourceManager.Load()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.<>c.<.cctor>b__8_0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location --- at System.Lazy1.CreateValue()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetLocalString(String id)
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetDescriptor(String id, String titleId, String descriptionId, DiagnosticSeverity severity, Boolean isEnabledByDefault, String[] args)
at SecurityCodeScan.Analyzers.Taint.LdapFilterTaintAnalyzer..cctor()
--- End of inner exception stack trace ---
at SecurityCodeScan.Analyzers.Taint.DeserializationTaintAnalyzer.get_TaintedDataEnteringSinkDescriptor()
at SecurityCodeScan.Analyzers.Taint.TaintAnalyzer.get_SupportedDiagnostics()
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerManager.AnalyzerExecutionContext.<>c__DisplayClass21_0.<ComputeDiagnosticDescriptors_NoLock>b__0(Object _)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action1 analyze, TArg argument, Nullable1 info, CancellationToken cancellationToken)

System.IO.FileNotFoundException: Could not load file or assembly 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'. The system cannot find the file specified.
File name: 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'
at SecurityCodeScan.Analyzers.Locale.YamlResourceManager.Load()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.<>c.<.cctor>b__8_0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location --- at System.Lazy1.CreateValue()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetLocalString(String id)
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetDescriptor(String id, String titleId, String descriptionId, DiagnosticSeverity severity, Boolean isEnabledByDefault, String[] args)
at SecurityCodeScan.Analyzers.Taint.LdapFilterTaintAnalyzer..cctor()

Analyzer 'SecurityCodeScan.Analyzers.Taint.DeserializationTaintAnalyzer' threw the following exception:
'System.TypeInitializationException: The type initializer for 'SecurityCodeScan.Analyzers.Taint.DeserializationTaintAnalyzer' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'. The system cannot find the file specified.
File name: 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'
at SecurityCodeScan.Analyzers.Locale.YamlResourceManager.Load()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.<>c.<.cctor>b__8_0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location --- at System.Lazy1.CreateValue()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetLocalString(String id)
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetDescriptor(String id, String titleId, String descriptionId, DiagnosticSeverity severity, Boolean isEnabledByDefault, String[] args)
at SecurityCodeScan.Analyzers.Taint.LdapFilterTaintAnalyzer..cctor()
--- End of inner exception stack trace ---
at SecurityCodeScan.Analyzers.Taint.DeserializationTaintAnalyzer.get_TaintedDataEnteringSinkDescriptor()
at SecurityCodeScan.Analyzers.Taint.TaintAnalyzer.get_SupportedDiagnostics()
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.CreateDisablingMessage(DiagnosticAnalyzer analyzer, String analyzerName)

System.IO.FileNotFoundException: Could not load file or assembly 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'. The system cannot find the file specified.
File name: 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'
at SecurityCodeScan.Analyzers.Locale.YamlResourceManager.Load()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.<>c.<.cctor>b__8_0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location --- at System.Lazy1.CreateValue()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetLocalString(String id)
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetDescriptor(String id, String titleId, String descriptionId, DiagnosticSeverity severity, Boolean isEnabledByDefault, String[] args)
at SecurityCodeScan.Analyzers.Taint.LdapFilterTaintAnalyzer..cctor()

'. 1_App_Code C:\Workspaces\W2G\W2G.sln 1 Active
Warning AD0001 Analyzer 'SecurityCodeScan.Analyzers.Taint.HardcodedPasswordAnalyzer' threw an exception of type 'System.TypeInitializationException' with message 'The type initializer for 'SecurityCodeScan.Analyzers.Taint.HardcodedPasswordAnalyzer' threw an exception.'.
System.TypeInitializationException: The type initializer for 'SecurityCodeScan.Analyzers.Taint.HardcodedPasswordAnalyzer' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'. The system cannot find the file specified.
File name: 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'
at SecurityCodeScan.Analyzers.Locale.YamlResourceManager.Load()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.<>c.<.cctor>b__8_0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location --- at System.Lazy1.CreateValue()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetLocalString(String id)
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetDescriptor(String id, String titleId, String descriptionId, DiagnosticSeverity severity, Boolean isEnabledByDefault, String[] args)
at SecurityCodeScan.Analyzers.Taint.LdapFilterTaintAnalyzer..cctor()
--- End of inner exception stack trace ---
at SecurityCodeScan.Analyzers.Taint.HardcodedPasswordAnalyzer.get_TaintedDataEnteringSinkDescriptor()
at SecurityCodeScan.Analyzers.Taint.ConstAnalyzer.get_SupportedDiagnostics()
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerManager.AnalyzerExecutionContext.<>c__DisplayClass21_0.<ComputeDiagnosticDescriptors_NoLock>b__0(Object _)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action1 analyze, TArg argument, Nullable1 info, CancellationToken cancellationToken)

System.IO.FileNotFoundException: Could not load file or assembly 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'. The system cannot find the file specified.
File name: 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'
at SecurityCodeScan.Analyzers.Locale.YamlResourceManager.Load()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.<>c.<.cctor>b__8_0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location --- at System.Lazy1.CreateValue()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetLocalString(String id)
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetDescriptor(String id, String titleId, String descriptionId, DiagnosticSeverity severity, Boolean isEnabledByDefault, String[] args)
at SecurityCodeScan.Analyzers.Taint.LdapFilterTaintAnalyzer..cctor()

Analyzer 'SecurityCodeScan.Analyzers.Taint.HardcodedPasswordAnalyzer' threw the following exception:
'System.TypeInitializationException: The type initializer for 'SecurityCodeScan.Analyzers.Taint.HardcodedPasswordAnalyzer' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'. The system cannot find the file specified.
File name: 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'
at SecurityCodeScan.Analyzers.Locale.YamlResourceManager.Load()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.<>c.<.cctor>b__8_0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location --- at System.Lazy1.CreateValue()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetLocalString(String id)
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetDescriptor(String id, String titleId, String descriptionId, DiagnosticSeverity severity, Boolean isEnabledByDefault, String[] args)
at SecurityCodeScan.Analyzers.Taint.LdapFilterTaintAnalyzer..cctor()
--- End of inner exception stack trace ---
at SecurityCodeScan.Analyzers.Taint.HardcodedPasswordAnalyzer.get_TaintedDataEnteringSinkDescriptor()
at SecurityCodeScan.Analyzers.Taint.ConstAnalyzer.get_SupportedDiagnostics()
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.CreateDisablingMessage(DiagnosticAnalyzer analyzer, String analyzerName)

System.IO.FileNotFoundException: Could not load file or assembly 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'. The system cannot find the file specified.
File name: 'YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'
at SecurityCodeScan.Analyzers.Locale.YamlResourceManager.Load()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.<>c.<.cctor>b__8_0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location --- at System.Lazy1.CreateValue()
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetLocalString(String id)
at SecurityCodeScan.Analyzers.Locale.LocaleUtil.GetDescriptor(String id, String titleId, String descriptionId, DiagnosticSeverity severity, Boolean isEnabledByDefault, String[] args)
at SecurityCodeScan.Analyzers.Taint.LdapFilterTaintAnalyzer..cctor()

'. 1_App_Code C:\Workspaces\W2G\W2G.sln 1 Active

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions