Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,27 @@ public void FileBasedApp_CentralPackageManagement_NoVersionSpecified_KeepExistin
""";
File.WriteAllText(directoryPackagesProps, directoryPackagesPropsSource);

// Create a local NuGet.config with package source mapping to avoid NU1507 warnings
var nugetConfig = Path.Join(testInstance.Path, "NuGet.config");
File.WriteAllText(nugetConfig, """
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="darc-pub-dotnet-dotnet" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-dotnet-4ef9fba1/nuget/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="Humanizer*" />
</packageSource>
<packageSource key="darc-pub-dotnet-dotnet">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
""");

new DotnetCommand(Log, args)
.WithWorkingDirectory(testInstance.Path)
.Execute()
Expand Down