diff --git a/.gitignore b/.gitignore index 764194f..8731a9d 100644 --- a/.gitignore +++ b/.gitignore @@ -65,4 +65,7 @@ packages/ *.dbmdl #Test files -*.testsettings \ No newline at end of file +*.testsettings + +#vs files +.vs/ \ No newline at end of file diff --git a/Asyncify.sln b/Asyncify.sln index 4da0fe4..b3082f1 100644 --- a/Asyncify.sln +++ b/Asyncify.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32014.148 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Asyncify", "Asyncify\Asyncify\Asyncify.csproj", "{C15B2F4D-99C3-4833-A9D0-32FFD969C248}" EndProject @@ -12,23 +12,40 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {C15B2F4D-99C3-4833-A9D0-32FFD969C248}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C15B2F4D-99C3-4833-A9D0-32FFD969C248}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C15B2F4D-99C3-4833-A9D0-32FFD969C248}.Debug|x86.ActiveCfg = Debug|Any CPU + {C15B2F4D-99C3-4833-A9D0-32FFD969C248}.Debug|x86.Build.0 = Debug|Any CPU {C15B2F4D-99C3-4833-A9D0-32FFD969C248}.Release|Any CPU.ActiveCfg = Release|Any CPU {C15B2F4D-99C3-4833-A9D0-32FFD969C248}.Release|Any CPU.Build.0 = Release|Any CPU + {C15B2F4D-99C3-4833-A9D0-32FFD969C248}.Release|x86.ActiveCfg = Release|Any CPU + {C15B2F4D-99C3-4833-A9D0-32FFD969C248}.Release|x86.Build.0 = Release|Any CPU {081DE494-482A-4B63-8C58-3FF52B548258}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {081DE494-482A-4B63-8C58-3FF52B548258}.Debug|Any CPU.Build.0 = Debug|Any CPU + {081DE494-482A-4B63-8C58-3FF52B548258}.Debug|x86.ActiveCfg = Debug|Any CPU + {081DE494-482A-4B63-8C58-3FF52B548258}.Debug|x86.Build.0 = Debug|Any CPU {081DE494-482A-4B63-8C58-3FF52B548258}.Release|Any CPU.ActiveCfg = Release|Any CPU {081DE494-482A-4B63-8C58-3FF52B548258}.Release|Any CPU.Build.0 = Release|Any CPU + {081DE494-482A-4B63-8C58-3FF52B548258}.Release|x86.ActiveCfg = Release|Any CPU + {081DE494-482A-4B63-8C58-3FF52B548258}.Release|x86.Build.0 = Release|Any CPU {86D26DFA-92B1-4F33-B350-F3302CD80239}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {86D26DFA-92B1-4F33-B350-F3302CD80239}.Debug|Any CPU.Build.0 = Debug|Any CPU + {86D26DFA-92B1-4F33-B350-F3302CD80239}.Debug|x86.ActiveCfg = Debug|x86 + {86D26DFA-92B1-4F33-B350-F3302CD80239}.Debug|x86.Build.0 = Debug|x86 {86D26DFA-92B1-4F33-B350-F3302CD80239}.Release|Any CPU.ActiveCfg = Release|Any CPU {86D26DFA-92B1-4F33-B350-F3302CD80239}.Release|Any CPU.Build.0 = Release|Any CPU + {86D26DFA-92B1-4F33-B350-F3302CD80239}.Release|x86.ActiveCfg = Release|x86 + {86D26DFA-92B1-4F33-B350-F3302CD80239}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {37544F4E-E18B-4A22-AF91-BAB46E38BE11} + EndGlobalSection EndGlobal diff --git a/Asyncify/Asyncify.Test/Asyncify.Test.csproj b/Asyncify/Asyncify.Test/Asyncify.Test.csproj index 1900641..95dee18 100644 --- a/Asyncify/Asyncify.Test/Asyncify.Test.csproj +++ b/Asyncify/Asyncify.Test/Asyncify.Test.csproj @@ -1,135 +1,15 @@ - - + - Debug - AnyCPU - 8.0.30703 - 2.0 - {081DE494-482A-4B63-8C58-3FF52B548258} - Library - Properties - Asyncify.Test - Asyncify.Test - v4.5.2 - 512 - + net6.0;net472 + latest - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - ..\..\packages\Microsoft.CodeAnalysis.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.dll - True - - - ..\..\packages\Microsoft.CodeAnalysis.CSharp.1.0.0\lib\net45\Microsoft.CodeAnalysis.CSharp.dll - True - - - ..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.1.0.0\lib\net45\Microsoft.CodeAnalysis.CSharp.Workspaces.dll - True - - - ..\..\packages\Microsoft.CodeAnalysis.VisualBasic.1.0.0\lib\net45\Microsoft.CodeAnalysis.VisualBasic.dll - True - - - ..\..\packages\Microsoft.CodeAnalysis.VisualBasic.Workspaces.1.0.0\lib\net45\Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll - True - - - ..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.Workspaces.dll - True - - - ..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.Workspaces.Desktop.dll - True - - - - ..\..\packages\System.Collections.Immutable.1.1.36\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - True - - - ..\..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll - True - - - ..\..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll - True - - - ..\..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Hosting.dll - True - - - ..\..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Runtime.dll - True - - - ..\..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll - True - - - - ..\..\packages\System.Reflection.Metadata.1.0.21\lib\portable-net45+win8\System.Reflection.Metadata.dll - True - - - - - - - - false - - - - - - - - - - - - - - - - - - {C15B2F4D-99C3-4833-A9D0-32FFD969C248} - Asyncify - + + + + - + - - \ No newline at end of file diff --git a/Asyncify/Asyncify.Test/Properties/AssemblyInfo.cs b/Asyncify/Asyncify.Test/Properties/AssemblyInfo.cs deleted file mode 100644 index 4b6a739..0000000 --- a/Asyncify/Asyncify.Test/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Asyncify.Test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Asyncify.Test")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/Asyncify/Asyncify.Test/Verifiers/DiagnosticVerifier.cs b/Asyncify/Asyncify.Test/Verifiers/DiagnosticVerifier.cs index 255064c..8a8242d 100644 --- a/Asyncify/Asyncify.Test/Verifiers/DiagnosticVerifier.cs +++ b/Asyncify/Asyncify.Test/Verifiers/DiagnosticVerifier.cs @@ -1,5 +1,4 @@ using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Collections.Generic; diff --git a/Asyncify/Asyncify.Test/packages.config b/Asyncify/Asyncify.Test/packages.config deleted file mode 100644 index 8f14e06..0000000 --- a/Asyncify/Asyncify.Test/packages.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/Asyncify/Asyncify.Vsix/Asyncify.Vsix.csproj b/Asyncify/Asyncify.Vsix/Asyncify.Vsix.csproj index 78fa414..3561e89 100644 --- a/Asyncify/Asyncify.Vsix/Asyncify.Vsix.csproj +++ b/Asyncify/Asyncify.Vsix/Asyncify.Vsix.csproj @@ -1,7 +1,7 @@  - + - 14.0 + 17.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) @@ -15,7 +15,7 @@ Properties Asyncify Asyncify - v4.5.2 + v4.7.2 false false false diff --git a/Asyncify/Asyncify.Vsix/source.extension.vsixmanifest b/Asyncify/Asyncify.Vsix/source.extension.vsixmanifest index a02efa1..f9937b7 100644 --- a/Asyncify/Asyncify.Vsix/source.extension.vsixmanifest +++ b/Asyncify/Asyncify.Vsix/source.extension.vsixmanifest @@ -1,21 +1,23 @@  - - - Asyncify.Vsix - This is a sample diagnostic extension for the .NET Compiler Platform ("Roslyn"). - - - - - - - - - - - - - - + + + Asyncify.Vsix + This is a sample diagnostic extension for the .NET Compiler Platform ("Roslyn"). + + + + amd64 + + + + + + + + + + + + diff --git a/Asyncify/Asyncify/Asyncify.csproj b/Asyncify/Asyncify/Asyncify.csproj index c61b0b1..2bff7f2 100644 --- a/Asyncify/Asyncify/Asyncify.csproj +++ b/Asyncify/Asyncify/Asyncify.csproj @@ -1,137 +1,54 @@ - - - - - 11.0 - Debug - AnyCPU - {C15B2F4D-99C3-4833-A9D0-32FFD969C248} - Library - Properties - Asyncify - Asyncify - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile7 - v4.5 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - True - True - Resources.resx - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - Designer - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - ..\..\packages\Microsoft.CodeAnalysis.Common.1.0.0\lib\portable-net45+win8\Microsoft.CodeAnalysis.dll - False - - - ..\..\packages\Microsoft.CodeAnalysis.CSharp.1.0.0\lib\portable-net45+win8\Microsoft.CodeAnalysis.CSharp.dll - False - - - ..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.1.0.0\lib\portable-net45+win8\Microsoft.CodeAnalysis.CSharp.Workspaces.dll - False - - - ..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0\lib\portable-net45+win8\Microsoft.CodeAnalysis.Workspaces.dll - False - - - ..\..\packages\System.Collections.Immutable.1.1.36\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - False - - - ..\..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll - False - - - ..\..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll - False - - - ..\..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Hosting.dll - False - - - ..\..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Runtime.dll - False - - - ..\..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll - False - - - ..\..\packages\System.Reflection.Metadata.1.0.21\lib\portable-net45+win8\System.Reflection.Metadata.dll - False - - - - - - - - - - - - + + + netstandard2.0 + latest + + + true + false + Asyncify + 1.0.0 + true + Asyncify is an analyzer that allows you to quickly update your code to use the Task Asynchronous Programming model. + Asyncify-CSharp is an analyzer and codefix that allows you to quickly update your code to use the Task Asynchronous Programming model. This model, introduced in C# 5, adds an intuitive way of handling asynchronous calls within C#. +The analyzer allows large codebases to be easily modified to use the TAP model by finding violations and applying fixes up the call tree. + Asyncify, analyzers, roslyn, async, await, task, asynchronous, TAP + true + True + Embedded + true + false + + --- 1.0.0 + Upgraded libs + --- 0.9.7 + Added interface refactoring + --- 0.9.6 + Bugfix for invocation not calling .Result + Bugfix for .Result calls outside of a method + Bugfix for variable access within a Lambda expression + --- 0.9.5707.38527 + First version of the nuget package. + Copyright Hans van Bakel 2015 + Hans van Bakel + LICENSE.MD + https://github.com/hvanbakel/Asyncify-CSharp + README.md + https://github.com/hvanbakel/Asyncify-CSharp + + + + + + + + + + + + True + \ + + + \ No newline at end of file diff --git a/Asyncify/Asyncify/Asyncify.nuspec b/Asyncify/Asyncify/Asyncify.nuspec deleted file mode 100644 index 8502f23..0000000 --- a/Asyncify/Asyncify/Asyncify.nuspec +++ /dev/null @@ -1,32 +0,0 @@ - - - - Asyncify - $version$ - Asyncify - Asncify is an analyzer that allows you to quickly update your code to use the Task Asynchronous Programming model. - Asyncify-CSharp is an analyzer and codefix that allows you to quickly update your code to use the Task Asynchronous Programming model. This model, introduced in C# 5, adds an intuitive way of handling asynchronous calls within C#. -The analyzer allows large codebases to be easily modified to use the TAP model by finding violations and applying fixes up the call tree. - - Hans van Bakel - Hans van Bakel - https://raw.githubusercontent.com/hvanbakel/Asyncify-CSharp/master/LICENSE.MD - https://github.com/hvanbakel/Asyncify-CSharp - false - - --- 0.9.7 - Added interface refactoring - --- 0.9.6 - Bugfix for invocation not calling .Result - Bugfix for .Result calls outside of a method - Bugfix for variable access within a Lambda expression - --- 0.9.5707.38527 - First version of the nuget package. - Copyright Hans van Bakel 2015 - Asyncify, analyzers, roslyn, async, await, task, asynchronous, TAP - - - - - - \ No newline at end of file diff --git a/Asyncify/Asyncify/InvocationAnalyzer.cs b/Asyncify/Asyncify/InvocationAnalyzer.cs index 5011b71..2a7116d 100644 --- a/Asyncify/Asyncify/InvocationAnalyzer.cs +++ b/Asyncify/Asyncify/InvocationAnalyzer.cs @@ -24,6 +24,8 @@ public class InvocationAnalyzer : DiagnosticAnalyzer public override void Initialize(AnalysisContext context) { + context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); + context.EnableConcurrentExecution(); context.RegisterSyntaxNodeAction(CheckInvocation, SyntaxKind.InvocationExpression); } diff --git a/Asyncify/Asyncify/InvocationChecker.cs b/Asyncify/Asyncify/InvocationChecker.cs index 6276f9a..ca56cf1 100644 --- a/Asyncify/Asyncify/InvocationChecker.cs +++ b/Asyncify/Asyncify/InvocationChecker.cs @@ -83,8 +83,8 @@ private bool IsTask(INamedTypeSymbol returnType) } return returnType.IsGenericType ? - returnType.ConstructedFrom.Equals(taskOfTSymbol.Value) : - returnType.Equals(taskSymbol.Value); + returnType.ConstructedFrom.Equals(taskOfTSymbol.Value, SymbolEqualityComparer.Default) : + returnType.Equals(taskSymbol.Value, SymbolEqualityComparer.Default); } } } diff --git a/Asyncify/Asyncify/Properties/AssemblyInfo.cs b/Asyncify/Asyncify/Properties/AssemblyInfo.cs deleted file mode 100644 index 9786657..0000000 --- a/Asyncify/Asyncify/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("C# Asyncify")] -[assembly: AssemblyDescription("Visual Studio Analyzer To Asyncify Your Code")] -[assembly: AssemblyProduct("Asyncify-CSharp")] -[assembly: AssemblyCopyright("Copyright © 2015")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("0.9.7")] -[assembly: AssemblyFileVersion("0.9.7")] diff --git a/Asyncify/Asyncify/VariableAccessAnalyzer.cs b/Asyncify/Asyncify/VariableAccessAnalyzer.cs index 4500539..4787c1f 100644 --- a/Asyncify/Asyncify/VariableAccessAnalyzer.cs +++ b/Asyncify/Asyncify/VariableAccessAnalyzer.cs @@ -25,6 +25,8 @@ public class VariableAccessAnalyzer : DiagnosticAnalyzer public override void Initialize(AnalysisContext context) { + context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); + context.EnableConcurrentExecution(); context.RegisterSyntaxNodeAction(CheckMemberAccess, SyntaxKind.SimpleMemberAccessExpression); } diff --git a/Asyncify/Asyncify/VariableAccessChecker.cs b/Asyncify/Asyncify/VariableAccessChecker.cs index a3357d0..a519bd6 100644 --- a/Asyncify/Asyncify/VariableAccessChecker.cs +++ b/Asyncify/Asyncify/VariableAccessChecker.cs @@ -45,8 +45,8 @@ public bool ShouldUseTap(MemberAccessExpressionSyntax memberAccessExpression) var taskOfTSymbol = semanticModel.Compilation.GetTypeByMetadataName(typeof(Task).FullName + "`1"); return symbol.IsGenericType ? - symbol.ConstructedFrom.Equals(taskOfTSymbol) : - symbol.Equals(taskSymbol); + symbol.ConstructedFrom.Equals(taskOfTSymbol, SymbolEqualityComparer.Default) : + symbol.Equals(taskSymbol, SymbolEqualityComparer.Default); } private INamedTypeSymbol FindSymbol(ExpressionSyntax expression) diff --git a/Asyncify/Asyncify/packages.config b/Asyncify/Asyncify/packages.config deleted file mode 100644 index 0f2d50f..0000000 --- a/Asyncify/Asyncify/packages.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/Asyncify/Asyncify/tools/install.ps1 b/Asyncify/Asyncify/tools/install.ps1 deleted file mode 100644 index 8178834..0000000 --- a/Asyncify/Asyncify/tools/install.ps1 +++ /dev/null @@ -1,49 +0,0 @@ -param($installPath, $toolsPath, $package, $project) - -$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers" ) * -Resolve - -foreach($analyzersPath in $analyzersPaths) -{ - # Install the language agnostic analyzers. - if (Test-Path $analyzersPath) - { - foreach ($analyzerFilePath in Get-ChildItem $analyzersPath -Filter *.dll) - { - if($project.Object.AnalyzerReferences) - { - $project.Object.AnalyzerReferences.Add($analyzerFilePath.FullName) - } - } - } -} - -# $project.Type gives the language name like (C# or VB.NET) -$languageFolder = "" -if($project.Type -eq "C#") -{ - $languageFolder = "cs" -} -if($project.Type -eq "VB.NET") -{ - $languageFolder = "vb" -} -if($languageFolder -eq "") -{ - return -} - -foreach($analyzersPath in $analyzersPaths) -{ - # Install language specific analyzers. - $languageAnalyzersPath = join-path $analyzersPath $languageFolder - if (Test-Path $languageAnalyzersPath) - { - foreach ($analyzerFilePath in Get-ChildItem $languageAnalyzersPath -Filter *.dll) - { - if($project.Object.AnalyzerReferences) - { - $project.Object.AnalyzerReferences.Add($analyzerFilePath.FullName) - } - } - } -} \ No newline at end of file diff --git a/Asyncify/Asyncify/tools/uninstall.ps1 b/Asyncify/Asyncify/tools/uninstall.ps1 deleted file mode 100644 index 9130bcb..0000000 --- a/Asyncify/Asyncify/tools/uninstall.ps1 +++ /dev/null @@ -1,56 +0,0 @@ -param($installPath, $toolsPath, $package, $project) - -$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers" ) * -Resolve - -foreach($analyzersPath in $analyzersPaths) -{ - # Uninstall the language agnostic analyzers. - if (Test-Path $analyzersPath) - { - foreach ($analyzerFilePath in Get-ChildItem $analyzersPath -Filter *.dll) - { - if($project.Object.AnalyzerReferences) - { - $project.Object.AnalyzerReferences.Remove($analyzerFilePath.FullName) - } - } - } -} - -# $project.Type gives the language name like (C# or VB.NET) -$languageFolder = "" -if($project.Type -eq "C#") -{ - $languageFolder = "cs" -} -if($project.Type -eq "VB.NET") -{ - $languageFolder = "vb" -} -if($languageFolder -eq "") -{ - return -} - -foreach($analyzersPath in $analyzersPaths) -{ - # Uninstall language specific analyzers. - $languageAnalyzersPath = join-path $analyzersPath $languageFolder - if (Test-Path $languageAnalyzersPath) - { - foreach ($analyzerFilePath in Get-ChildItem $languageAnalyzersPath -Filter *.dll) - { - if($project.Object.AnalyzerReferences) - { - try - { - $project.Object.AnalyzerReferences.Remove($analyzerFilePath.FullName) - } - catch - { - - } - } - } - } -} \ No newline at end of file