Skip to content

Commit

Permalink
Enable NuGet Audit and fix issues (dotnet#107639)
Browse files Browse the repository at this point in the history
* Enable NuGet Audit and fix issues

Microsoft.NET.HostModel can reference the live builds of the packages
it depends on.  These will be deployed by the SDK.�
Most other audit alerts were due to tasks pulling in old dependencies
that aren't even used by the task. Avoid these by cherry-picking
just the assemblies needed by the tasks and provided by MSBuild / SDK.
This prevents NuGet from downloading the package closure with the
vulnerable packages.  We don't need those packages since the tasks
aren't responsible for deploying them.  A better solution in the future
would be a targeting pack for MSBuild and the .NET SDK - so that
components that contribute to these hosts have a surface area they can
target without taking on responsibility for servicing.

There is once case where we have a test that references NuGet.* packages
which also bring in stale dependencies that overlap with framework
assemblies.  Avoid these by cherry-picking the NuGet packages in the
same way.

* Fix package path on linux

* Only use live JSON from HostModel

SDK pins S.R.M and a few others, so don't make them upgrade yet.

* Add a couple missing assembly references

* Refactor tasks dependencies

Consolidate representation of msbuild-provided task dependencies

* Fix audit warnings in tests

* Remove MetadataLoadContext from WasmAppBuilder package

* Update Analyzer.Testing packages

* Reduce exposure of Microsoft.Build.Tasks.Core

* Fix audit warnings that only occur on browser

* Update Asn1 used by linker analyzer tests

* React to breaking change in analyzer test SDK

* Enable working DryIoc tests

* Fix double-write when LibrariesConfiguration differs from Configuration

* Fix LibrariesConfiguration update target

* Clean up references and add comments.

* Make HostModel references private

This ensures projects referenced will not be rebuilt by tests.

This also means the HostModel package will not list these as references,
but that's OK since the SDK provides them and this is not a shipping
package.

* Use ProjectReferenceExclusion to avoid framework project references

On .NETCore we want to use the targeting pack and avoid rebuilding libs.

* Update src/libraries/System.Runtime.InteropServices.JavaScript/tests/JSImportGenerator.UnitTest/JSImportGenerator.Unit.Tests.csproj

Co-authored-by: Jeremy Koritzinsky <[email protected]>

---------

Co-authored-by: Jeremy Koritzinsky <[email protected]>
  • Loading branch information
ericstj and jkoritzinsky committed Oct 14, 2024
1 parent b030c4d commit 9177034
Show file tree
Hide file tree
Showing 42 changed files with 176 additions and 118 deletions.
4 changes: 2 additions & 2 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@
<Target Name="FilterTransitiveProjectReferences"
AfterTargets="IncludeTransitiveProjectReferences"
Condition="'$(DisableTransitiveProjectReferences)' != 'true' and
'@(DefaultReferenceExclusion)' != ''">
('@(DefaultReferenceExclusion)' != '' or '@(ProjectReferenceExclusion)' != '')">
<ItemGroup>
<_transitiveProjectReferenceWithProjectName Include="@(ProjectReference->Metadata('NuGetPackageId'))"
OriginalIdentity="%(Identity)" />
<_transitiveIncludedProjectReferenceWithProjectName Include="@(_transitiveProjectReferenceWithProjectName)"
Exclude="@(DefaultReferenceExclusion)" />
Exclude="@(DefaultReferenceExclusion);@(ProjectReferenceExclusion)" />
<_transitiveExcludedProjectReferenceWithProjectName Include="@(_transitiveProjectReferenceWithProjectName)"
Exclude="@(_transitiveIncludedProjectReferenceWithProjectName)" />
<ProjectReference Remove="@(_transitiveExcludedProjectReferenceWithProjectName->Metadata('OriginalIdentity'))" />
Expand Down
4 changes: 4 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
<add key="dotnet9-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9-transport/nuget/v3/index.json" />
</packageSources>
<auditSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</auditSources>
<disabledPackageSources>
<clear />
</disabledPackageSources>
Expand Down
33 changes: 33 additions & 0 deletions eng/PackageDownloadAndReference.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project>

<!-- These file supports using PackageDownloadAndReference items.
The PackageDownloadAndReference item is used to download a package and reference it in the project, without restoring the package's dependency closure.
When using PackageDownloadAndReference you are responsible for selecting the correct assets from the package and ensuring that the package and it's
dependencies are available at runtime.
The PackageDownloadAndReference item has the following metadata:
- Folder: The folder in the package where the assembly is located.
- AssemblyName: The name of the assembly to reference.
- Private: Whether the reference should be private (copied to the output directory) or not. Default is false.
A common use case for PackageDownloadAndReference is to reference assemblies provided by MSBuild or the .NET SDK.
-->

<ItemDefinitionGroup>
<PackageDownloadAndReference>
<Folder>lib/$(TargetFramework)</Folder>
<AssemblyName>%(Identity)</AssemblyName>
<Private>false</Private>
</PackageDownloadAndReference>
</ItemDefinitionGroup>

<ItemGroup>
<PackageDownload Include="@(PackageDownloadAndReference)" />
<PackageDownload Update="@(PackageDownloadAndReference)" Version="[%(Version)]"/>
<PackageDownloadAndReference Update="@(PackageDownloadAndReference)" PackageFolder="$([System.String]::new(%(Identity)).ToLowerInvariant())" />
<Reference Include="@(PackageDownloadAndReference->'$(NuGetPackageRoot)%(PackageFolder)/%(Version)/%(Folder)/%(AssemblyName).dll')" />
</ItemGroup>

</Project>
12 changes: 12 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,22 @@
</Dependency>
<!-- Necessary for source-build. This allows the package to be retrieved from previously-source-built artifacts
and flow in as dependencies of the packages produced by runtime. -->
<Dependency Name="Nuget.Frameworks" Version="6.2.4">
<Uri>https://github.com/NuGet/NuGet.Client</Uri>
<Sha>8fef55f5a55a3b4f2c96cd1a9b5ddc51d4b927f8</Sha>
</Dependency>
<Dependency Name="Nuget.Packaging" Version="6.2.4">
<Uri>https://github.com/NuGet/NuGet.Client</Uri>
<Sha>8fef55f5a55a3b4f2c96cd1a9b5ddc51d4b927f8</Sha>
</Dependency>
<Dependency Name="Nuget.ProjectModel" Version="6.2.4">
<Uri>https://github.com/NuGet/NuGet.Client</Uri>
<Sha>8fef55f5a55a3b4f2c96cd1a9b5ddc51d4b927f8</Sha>
</Dependency>
<Dependency Name="Nuget.Versioning" Version="6.2.4">
<Uri>https://github.com/NuGet/NuGet.Client</Uri>
<Sha>8fef55f5a55a3b4f2c96cd1a9b5ddc51d4b927f8</Sha>
</Dependency>
<Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.Wasm.Node.Transport" Version="9.0.0-alpha.1.24175.1">
<Uri>https://github.com/dotnet/node</Uri>
<Sha>308c7d0f1fa19bd1e7b768ad13646f5206133cdb</Sha>
Expand Down
7 changes: 5 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
<SystemComponentModelAnnotationsVersion>5.0.0</SystemComponentModelAnnotationsVersion>
<SystemDataSqlClientVersion>4.8.6</SystemDataSqlClientVersion>
<SystemDrawingCommonVersion>8.0.0</SystemDrawingCommonVersion>
<SystemFormatsAsn1Version>8.0.1</SystemFormatsAsn1Version>
<SystemIOFileSystemAccessControlVersion>5.0.0</SystemIOFileSystemAccessControlVersion>
<SystemMemoryVersion>4.5.5</SystemMemoryVersion>
<SystemReflectionMetadataVersion>9.0.0-rtm.24503.8</SystemReflectionMetadataVersion>
Expand All @@ -136,7 +137,7 @@
<runtimenativeSystemIOPortsVersion>9.0.0-rtm.24503.8</runtimenativeSystemIOPortsVersion>
<!-- Keep toolset versions in sync with dotnet/msbuild and dotnet/sdk -->
<SystemCollectionsImmutableToolsetVersion>8.0.0</SystemCollectionsImmutableToolsetVersion>
<SystemTextJsonToolsetVersion>8.0.0</SystemTextJsonToolsetVersion>
<SystemTextJsonToolsetVersion>8.0.4</SystemTextJsonToolsetVersion>
<SystemReflectionMetadataToolsetVersion>8.0.0</SystemReflectionMetadataToolsetVersion>
<SystemReflectionMetadataLoadContextToolsetVersion>8.0.0</SystemReflectionMetadataLoadContextToolsetVersion>
<!-- Runtime-Assets dependencies -->
Expand Down Expand Up @@ -174,8 +175,10 @@
<MicrosoftBuildTasksCoreVersion>$(MicrosoftBuildVersion)</MicrosoftBuildTasksCoreVersion>
<MicrosoftBuildFrameworkVersion>$(MicrosoftBuildVersion)</MicrosoftBuildFrameworkVersion>
<MicrosoftBuildUtilitiesCoreVersion>$(MicrosoftBuildVersion)</MicrosoftBuildUtilitiesCoreVersion>
<NugetFrameworksVersion>6.2.4</NugetFrameworksVersion>
<NugetProjectModelVersion>6.2.4</NugetProjectModelVersion>
<NugetPackagingVersion>6.2.4</NugetPackagingVersion>
<NugetVersioningVersion>6.2.4</NugetVersioningVersion>
<DotnetSosVersion>7.0.412701</DotnetSosVersion>
<DotnetSosTargetFrameworkVersion>6.0</DotnetSosTargetFrameworkVersion>
<!-- Testing -->
Expand Down Expand Up @@ -205,7 +208,7 @@
<GrpcCoreVersion>2.46.3</GrpcCoreVersion>
<GrpcDotnetClientVersion>2.45.0</GrpcDotnetClientVersion>
<GrpcToolsVersion>2.45.0</GrpcToolsVersion>
<CompilerPlatformTestingVersion>1.1.2-beta1.23323.1</CompilerPlatformTestingVersion>
<CompilerPlatformTestingVersion>1.1.3-beta1.24423.1</CompilerPlatformTestingVersion>
<CompilerPlatformTestingDiffPlexVersion>1.7.2</CompilerPlatformTestingDiffPlexVersion>
<CompilerPlatformTestingMicrosoftVisualBasicVersion>10.2.0</CompilerPlatformTestingMicrosoftVisualBasicVersion>
<CompilerPlatformTestingMicrosoftVisualStudioCompositionVersion>17.0.46</CompilerPlatformTestingMicrosoftVisualStudioCompositionVersion>
Expand Down
12 changes: 12 additions & 0 deletions src/installer/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
<ArchiveName Condition="'$(PgoInstrument)' != ''">$(ArchiveName)-pgo</ArchiveName>
</PropertyGroup>

<!-- Libraries might be built with a different Configuration,,
make sure we honor that when building ProjectReferences. -->
<Target Name="UpdateLibrariesProjectReferenceConfiguration" AfterTargets="IncludeTransitiveProjectReferences">
<FindUnderPath Files="@(ProjectReference)" Path="$(LibrariesProjectRoot)">
<Output TaskParameter="InPath" ItemName="LibrariesProjectReference" />
</FindUnderPath>
<ItemGroup>
<ProjectReference Remove="@(LibrariesProjectReference)" />
<ProjectReference Include="@(LibrariesProjectReference)" SetConfiguration="Configuration=$(LibrariesConfiguration)"/>
</ItemGroup>
</Target>

<!--
Import stubs for compatibility with packaging tools, if not building a pkgproj. Ordinarily,
listing this before the ../Directory.Build.targets import would be sufficient, but the packaging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
</PropertyGroup>

<ItemGroup>
<!-- SDK pins this to a lower version https://github.com/dotnet/sdk/issues/43325 -->
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataToolsetVersion)" />
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonToolsetVersion)" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Text.Json\src\System.Text.Json.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/installer/tests/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<Project>

<!-- Exclude any ProjectReferences to framework assemblies on the latest framework -->
<Import Project="$(LibrariesProjectRoot)NetCoreAppLibrary.props" Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'" />
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
<ProjectReferenceExclusion Include="@(NetCoreAppLibrary)" />
</ItemGroup>

<Target Name="SetupTestContextVariables"
Condition="'$(IsTestProject)' == 'true'"
DependsOnTargets="
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@

<ItemGroup>
<PackageReference Include="NuGet.Packaging" Version="$(NugetPackagingVersion)" />
<!-- Upgrade to a non-vulnerable version of Asn1 - which will be ignored in favor of the framework copy -->
<PackageReference Include="System.Formats.Asn1" Version="$(SystemFormatsAsn1Version)" ExcludeAssets="All" />
</ItemGroup>

<Import Project="$(RepositoryEngineeringDir)PackageDownloadAndReference.targets" />

<ItemGroup>
<ProjectReference Include="..\TestUtils\TestUtils.csproj" />
<OrderProjectReference Include="@(PkgprojProjectToBuild)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Kerberos.NET" Version="4.5.178" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Security.Cryptography.Pkcs\src\System.Security.Cryptography.Pkcs.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ namespace Microsoft.Extensions.DependencyInjection.Specification
{
public class DryIocDependencyInjectionSpecificationTests : SkippableDependencyInjectionSpecificationTests
{
public override bool SupportsIServiceProviderIsService => false;

public override string[] SkippedTests => new[]
{
"ServiceScopeFactoryIsSingleton"
};
public override string[] SkippedTests => [];

protected override IServiceProvider CreateServiceProviderImpl(IServiceCollection serviceCollection)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.DependencyInjection\src\Microsoft.Extensions.DependencyInjection.csproj" SkipUseReferenceAssembly="true" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.DependencyInjection.Abstractions\src\Microsoft.Extensions.DependencyInjection.Abstractions.csproj" SkipUseReferenceAssembly="true" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.DependencyInjection.Specification.Tests\src\Microsoft.Extensions.DependencyInjection.Specification.Tests.csproj" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="DryIoc.Microsoft.DependencyInjection" Version="5.1.0" />
<PackageReference Include="LightInject.Microsoft.DependencyInjection" Version="3.5.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
<PackageReference Include="DryIoc.Microsoft.DependencyInjection" Version="6.2.0" />
<PackageReference Include="LightInject.Microsoft.DependencyInjection" Version="3.7.1" />
<PackageReference Include="Grace.DependencyInjection.Extensions" Version="7.1.0" />
<PackageReference Include="Stashbox.Extensions.Dependencyinjection" Version="4.2.3" />
</ItemGroup>

<!-- These packages don't support .NETFramework -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<PackageReference Include="Lamar.Microsoft.DependencyInjection" Version="8.0.1" />
<!-- Lamar depends on System.Runtime.Loader which brings in 1.x packages.
Those have audit warnings when runtime.* packages are brought in for RID-specific restore.
Avoid by referencing the latest Microsoft.NETCore.Targets which will prevent all 1.x runtime.* packages from being referenced. -->
<PackageReference Include="Microsoft.NETCore.Targets" Version="5.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Logging.Abstractions\src\Microsoft.Extensions.Logging.Abstractions.csproj" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="$(RoslynApiVersion)" />
<!-- Ensure we are using live dependencies for CodeAnalysis rather than old packages -->
<PackageReference Include="NETStandard.Library" Version="$(NETStandardLibraryVersion)" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Composition\src\System.Composition.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.IO.Pipelines\src\System.IO.Pipelines.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Reflection.Metadata\src\System.Reflection.Metadata.csproj" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="$(SQLitePCLRawbundle_greenVersion)" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,16 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCoreVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<!-- Manually reference these assemblies which are provided by MSBuild / .NET SDK -->
<PackageDownloadAndReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" Folder="ref/net472" Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net472'))" />
<PackageDownloadAndReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" Folder="ref/net8.0" Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))" />
<PackageDownloadAndReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCoreVersion)" Folder="ref/net472" Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net472'))" />
<PackageDownloadAndReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCoreVersion)" Folder="ref/net8.0" Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))" />
<PackageDownloadAndReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" Folder="lib/netstandard2.0" />
</ItemGroup>


<Import Project="$(RepositoryEngineeringDir)PackageDownloadAndReference.targets" />

<UsingTask TaskName="UpdateRuntimeIdentifierGraph" AssemblyFile="$(_generateRuntimeGraphTask)"/>
<Target Name="UpdateRuntimeIdentifierGraph"
AfterTargets="Build"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCoreVersion)">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<ProjectReference Include="$(LibrariesProjectRoot)System.Reflection.Metadata\src\System.Reflection.Metadata.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<PackageReference Include="DiffPlex" Version="$(CompilerPlatformTestingDiffPlexVersion)" />
<PackageReference Include="Microsoft.VisualBasic" Version="$(CompilerPlatformTestingMicrosoftVisualBasicVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="$(CompilerPlatformTestingMicrosoftVisualStudioCompositionVersion)" />
<!-- Upgrade to a non-vulnerable version of Asn1 - which will be ignored in favor of the framework copy -->
<PackageReference Include="System.Formats.Asn1" Version="$(SystemFormatsAsn1Version)" ExcludeAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<Nullable>enable</Nullable>
<TestRunRequiresLiveRefPack>true</TestRunRequiresLiveRefPack>
<IgnoreForCI Condition="'$(TargetsMobile)' == 'true' or '$(TargetsLinuxBionic)' == 'true' or '$(TargetArchitecture)' == 'ARMv6'">true</IgnoreForCI>
<IgnoreForCI Condition="'$(TargetsMobile)' == 'true' or '$(TargetsLinuxBionic)' == 'true' or '$(TargetArchitecture)' == 'ARMv6'">true</IgnoreForCI>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CommonTestPath)SourceGenerators\LiveReferencePack.cs" Link="Common\SourceGenerators\LiveReferencePack.cs" />
Expand All @@ -25,6 +25,9 @@
<PackageReference Include="Microsoft.VisualBasic" Version="$(CompilerPlatformTestingMicrosoftVisualBasicVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="$(CompilerPlatformTestingMicrosoftVisualStudioCompositionVersion)" />

<!-- Upgrade to a non-vulnerable version of Asn1 - which will be ignored in favor of the framework copy -->
<PackageReference Include="System.Formats.Asn1" Version="$(SystemFormatsAsn1Version)" ExcludeAssets="all" />

<None Include="$(RepoRoot)/NuGet.config" Link="NuGet.config" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<PackageReference Include="DiffPlex" Version="$(CompilerPlatformTestingDiffPlexVersion)" />
<PackageReference Include="Microsoft.VisualBasic" Version="$(CompilerPlatformTestingMicrosoftVisualBasicVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="$(CompilerPlatformTestingMicrosoftVisualStudioCompositionVersion)" />

<!-- Upgrade to a non-vulnerable version of Asn1 - which will be ignored in favor of the framework copy -->
<PackageReference Include="System.Formats.Asn1" Version="$(SystemFormatsAsn1Version)" ExcludeAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class CustomMarshallerAttributeFixerTest : CSharpCodeFixVerifier<Custom
// In particular, sort the equivalent subgroups by their diagnostic descriptor in the order that the fixer's fix-all provider
// will add the methods.
// This ensures that the iterative code-fix test will produce the same (deterministic) output as the fix-all tests.
protected override ImmutableArray<(Project project, Diagnostic diagnostic)> SortDistinctDiagnostics(IEnumerable<(Project project, Diagnostic diagnostic)> diagnostics)
protected override ImmutableArray<(Project project, Diagnostic diagnostic)> SortDistinctDiagnostics(ImmutableArray<(Project project, Diagnostic diagnostic)> diagnostics)
=> diagnostics.OrderBy(d => d.diagnostic.Location.GetLineSpan().Path, StringComparer.Ordinal)
.ThenBy(d => d.diagnostic.Location.SourceSpan.Start)
.ThenBy(d => d.diagnostic.Location.SourceSpan.End)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
<PackageReference Include="DiffPlex" Version="$(CompilerPlatformTestingDiffPlexVersion)" />
<PackageReference Include="Microsoft.VisualBasic" Version="$(CompilerPlatformTestingMicrosoftVisualBasicVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="$(CompilerPlatformTestingMicrosoftVisualStudioCompositionVersion)" />

<!-- Upgrade to a non-vulnerable version of Asn1 - which will be ignored in favor of the framework copy -->
<PackageReference Include="System.Formats.Asn1" Version="$(SystemFormatsAsn1Version)" ExcludeAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
<EnableLibraryImportGenerator>false</EnableLibraryImportGenerator>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCoreVersion)">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<Compile Include="*.cs" />
</ItemGroup>
Expand Down
Loading

0 comments on commit 9177034

Please sign in to comment.