Closed v-luzh closed 8 months ago
It seems like the version of the SDK you're using is not compatible with the version of the NuGet SDK you're patching with.
Which version of the NuGet packages are you patching with? How is that version chosen?
FWIW, 7.0.400 of the SDK matches, 6.7 of NuGet: https://learn.microsoft.com/en-us/nuget/release-notes/nuget-6.7.
Patching it with any other version is not guaranteed to work. It does most of the time but it's not guaranteed.
After meeting, the script hard codes latest channel: https://github.com/NuGet/Entropy/blob/5c73e37028b79b65bb95bf4593286bbbc4f65761/SDKPatchTool/patchOnWindows.ps1#L14.
@nkolev92, we used NuGet Client Dev\6.9.0.85 to patch last time. In our regular Dotnet List Packages Test/Package Signing Test/Cross-platform Verify Test/Cross-platform Dotnet Sign Test, we were asked to set the $SDKChannel = "7.0" in the SDKPatchTools of Entropy. They all work well, but it failed this time.
We tried the value of $SDKChannel as "9.0", but running patchOnWindows.ps1 would failed. And we also tried the "LTS" as the guidance below, and it will patch the latest .NET SDK 7.0.
-Channel|--channel
Specifies the source channel for the installation. The possible values are:
STS: The most recent Standard Term Support release. LTS: The most recent Long Term Support release. Two-part version in A.B format, representing a specific release (for example, 3.1 or 6.0). Three-part version in A.B.Cxx format, representing a specific SDK release (for example, 6.0.1xx or 6.0.2xx). Available since the 5.0 release.
6.9 will match 8.0.200, so the chnanel needs to be 8.0.
I've updated the script, simplified it significantly, can you please try it and let me know how it goes?
Note the script name change, and the fact that you will not need to use different scripts on linux and windows.
Hi @nkolev92, the patching is successful, but it patched with .NET SDK 8.0.101. It still fails to run the Dotnet List Package Test.ps1 as below.
cd C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage
PS C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage> .\Test.ps1
Getting latest .NET Core CLI
Testing the following version of the .NET Core CLI/SDK
8.0.101
Creating test package projects
The template "Class Library" was created successfully.
Processing post-creation actions...
Restoring C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\MyLib.csproj:
Determining projects to restore...
Restored C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\MyLib.csproj (in 169 ms).
Restore succeeded.
The template "Class Library" was created successfully.
Processing post-creation actions...
Restoring C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\MyDep.csproj:
Determining projects to restore...
Restored C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\MyDep.csproj (in 117 ms).
Restore succeeded.
Reference `..\MyDep\MyDep.csproj` added to the project.
The template "Solution File" was created successfully.
Project `MyLib\MyLib.csproj` added to the solution.
Project `MyDep\MyDep.csproj` added to the solution.
MSBuild version 17.8.3+195e7f5a3 for .NET
Determining projects to restore...
Restored C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\MyLib.csproj (in 185 ms).
1 of 2 projects are up-to-date for restore.
MyDep -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\net8.0\MyDep.dll
MyLib -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\net8.0\MyLib.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:03.82
Creating packages
MSBuild version 17.8.3+195e7f5a3 for .NET
MyDep -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\net8.0\MyDep.dll
The package MyDep.1.0.1 is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why
package readmes are important.
Successfully created package 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\MyDep.1.0.1.nupkg'.
MyLib -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\net8.0\MyLib.dll
The package MyLib.1.0.1 is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why
package readmes are important.
Successfully created package 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\MyLib.1.0.1.nupkg'.
MSBuild version 17.8.3+195e7f5a3 for .NET
MyDep -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\net8.0\MyDep.dll
The package MyDep.1.0.2 is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why
package readmes are important.
Successfully created package 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\MyDep.1.0.2.nupkg'.
MyLib -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\net8.0\MyLib.dll
The package MyLib.1.0.2 is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why
package readmes are important.
Successfully created package 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\MyLib.1.0.2.nupkg'.
MSBuild version 17.8.3+195e7f5a3 for .NET
MyDep -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\net8.0\MyDep.dll
The package MyDep.1.0.3-beta is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn
why package readmes are important.
Successfully created package 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\MyDep.1.0.3-beta.nupk
g'.
MyLib -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\net8.0\MyLib.dll
The package MyLib.1.0.3-beta is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn
why package readmes are important.
Successfully created package 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\MyLib.1.0.3-beta.nupk
g'.
MSBuild version 17.8.3+195e7f5a3 for .NET
MyDep -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\net8.0\MyDep.dll
The package MyDep.1.1.0 is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why
package readmes are important.
Successfully created package 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\MyDep.1.1.0.nupkg'.
MyLib -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\net8.0\MyLib.dll
The package MyLib.1.1.0 is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why
package readmes are important.
Successfully created package 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\MyLib.1.1.0.nupkg'.
MSBuild version 17.8.3+195e7f5a3 for .NET
MyDep -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\net8.0\MyDep.dll
The package MyDep.1.2.0-beta is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn
why package readmes are important.
Successfully created package 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\MyDep.1.2.0-beta.nupk
g'.
MyLib -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\net8.0\MyLib.dll
The package MyLib.1.2.0-beta is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn
why package readmes are important.
Successfully created package 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\MyLib.1.2.0-beta.nupk
g'.
MSBuild version 17.8.3+195e7f5a3 for .NET
MyDep -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\net8.0\MyDep.dll
The package MyDep.2.0.0 is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why
package readmes are important.
Successfully created package 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\MyDep.2.0.0.nupkg'.
MyLib -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\net8.0\MyLib.dll
The package MyLib.2.0.0 is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why
package readmes are important.
Successfully created package 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\MyLib.2.0.0.nupkg'.
MSBuild version 17.8.3+195e7f5a3 for .NET
MyDep -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\net8.0\MyDep.dll
The package MyDep.3.0.0-beta is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn
why package readmes are important.
Successfully created package 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyDep\bin\Debug\MyDep.3.0.0-beta.nupk
g'.
MyLib -> C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\net8.0\MyLib.dll
The package MyLib.3.0.0-beta is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn
why package readmes are important.
Successfully created package 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyLib\bin\Debug\MyLib.3.0.0-beta.nupk
g'.
Creating nuget.config
The template "NuGet Config" was created successfully.
The template "Console App" was created successfully.
Processing post-creation actions...
Restoring C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyProg\MyProg.csproj:
Determining projects to restore...
Restored C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyProg\MyProg.csproj (in 179 ms).
Restore succeeded.
Determining projects to restore...
Writing C:\Users\v-luzh.FAREAST\AppData\Local\Temp\tmpsjragk.tmp
info : X.509 certificate chain validation will use the default trust store selected by .NET for code signing.
info : X.509 certificate chain validation will use the default trust store selected by .NET for timestamping.
info : Adding PackageReference for package 'MyLib' into project 'MyProg\MyProg.csproj'.
info : Restoring packages for C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyProg\MyProg.csproj...
info : CACHE https://api.nuget.org/v3-flatcontainer/mylib/index.json
info : Installed MyDep 1.0.1 from C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\localSource to C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\globalPackages\mydep\1.0.1 with content hash fdn2vWer2BHfFxSfb57LNwA2obMRljBQD9bni75qcr0bxNK56wix9zZYY4OkzyLthsFfKcY9VZFM4J+ZKVc7Sg==.
info : Installed MyLib 1.0.1 from C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\localSource to C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\globalPackages\mylib\1.0.1 with content hash FAnsRocw51K0NIr1+9sqCwTVnguX2AHg/r3HhePJoSWSmSMOZjwm/r1xLKEnXAP73Cfa31D/1Ga5lf1KAiOgmw==.
warn : NU1603: MyProg depends on MyLib (>= 1.0.0) but MyLib 1.0.0 was not found. An approximate best match of MyLib 1.0.1 was resolved.
info : CACHE https://api.nuget.org/v3/vulnerabilities/index.json
info : CACHE https://api.nuget.org/v3-vulnerabilities/2024.01.20.05.32.55/vulnerability.base.json
info : CACHE https://api.nuget.org/v3-vulnerabilities/2024.01.20.05.32.55/2024.01.23.17.33.22/vulnerability.update.json
info : Package 'MyLib' is compatible with all the specified frameworks in project 'MyProg\MyProg.csproj'.
info : PackageReference for package 'MyLib' version '1.0.0' added to file 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyProg\MyProg.csproj'.
info : Writing assets file to disk. Path: C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyProg\obj\project.assets.json
log : Restored C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyProg\MyProg.csproj (in 749 ms).
Determining projects to restore...
C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyProg\MyProg.csproj : warning NU1603: MyProg depends on MyLib (>= 1.
0.0) but MyLib 1.0.0 was not found. An approximate best match of MyLib 1.0.1 was resolved.
All projects are up-to-date for restore.
The template "Console App" was created successfully.
Processing post-creation actions...
Restoring C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\deprecationTest\deprecationTest.csproj:
Determining projects to restore...
Restored C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\deprecationTest\deprecationTest.csproj (in 135 ms).
Restore succeeded.
Determining projects to restore...
Writing C:\Users\v-luzh.FAREAST\AppData\Local\Temp\tmps30hfg.tmp
info : X.509 certificate chain validation will use the default trust store selected by .NET for code signing.
info : X.509 certificate chain validation will use the default trust store selected by .NET for timestamping.
info : Adding PackageReference for package 'NuGet.Core' into project '.\deprecationTest\deprecationTest.csproj'.
info : Restoring packages for C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\deprecationTest\deprecationTest.csproj...
info : CACHE https://api.nuget.org/v3-flatcontainer/nuget.core/index.json
info : CACHE https://api.nuget.org/v3-flatcontainer/nuget.core/2.14.0/nuget.core.2.14.0.nupkg
info : CACHE https://api.nuget.org/v3-flatcontainer/microsoft.web.xdt/index.json
info : CACHE https://api.nuget.org/v3-flatcontainer/microsoft.web.xdt/2.1.0/microsoft.web.xdt.2.1.0.nupkg
info : Installed Microsoft.Web.Xdt 2.1.0 from https://api.nuget.org/v3/index.json to C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\globalPackages\microsoft.web.xdt\2.1.0 with content hash /ieJ02r4MEJM21Eyl+c5kwoJWPhy+qEEcN68JaqDoamabgxJI1jGi/kNLuKvHUCl6tU7E0rMvaR6FmEnDWtS4A==.
info : Installed NuGet.Core 2.14.0 from https://api.nuget.org/v3/index.json to C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\globalPackages\nuget.core\2.14.0 with content hash UDXFLVRDepqVqyYxQuxujfaAc7XePdw+Lsey+q36iqTm0nuSU1n9laIGqjokvBl0unifYtjSai7fqBQKKd9BUg==.
info : CACHE https://api.nuget.org/v3/vulnerabilities/index.json
info : CACHE https://api.nuget.org/v3-vulnerabilities/2024.01.20.05.32.55/vulnerability.base.json
info : CACHE https://api.nuget.org/v3-vulnerabilities/2024.01.20.05.32.55/2024.01.23.17.33.22/vulnerability.update.json
warn : NU1701: Package 'Microsoft.Web.Xdt 2.1.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0'. This package may not be fully compatible with your project.
warn : NU1701: Package 'NuGet.Core 2.14.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0'. This package may not be fully compatible with your project.
info : Package 'NuGet.Core' is compatible with all the specified frameworks in project '.\deprecationTest\deprecationTest.csproj'.
info : PackageReference for package 'NuGet.Core' version '2.14.0' added to file 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\deprecationTest\deprecationTest.csproj'.
info : Writing assets file to disk. Path: C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\deprecationTest\obj\project.assets.json
log : Restored C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\deprecationTest\deprecationTest.csproj (in 866 ms).
error: Unexpected failure reading NuGet.Config. Path: 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyProg\MyProg.csproj\NuGet.Config'.
error: Cannot create 'C:\Users\v-luzh.FAREAST\Desktop\DotnetListPackage\MyProg\MyProg.csproj' because a file or directory with the same name already exists.
Usage: NuGet.CommandLine.XPlat.dll package list [arguments] [options]
Arguments:
<PROJECT | SOLUTION> A path to a project, solution file or directory.
Options:
-h|--help Show help information
--force-english-output Forces the application to run using an invariant, English-based culture.
--framework Specifies the target framework for which the packages will be listed.
--deprecated Displays only the packages marked deprecated by the authors.
--outdated Displays only the packages that need updates with the latest version from the sources.
--vulnerable Displays only the packages flagged as vulnerable.
--include-transitive Includes transitive packages too in the result.
--include-prerelease Considers prerelease versions when looking for latest. Works only with `--outdated`.
--highest-patch Considers only the versions with matching minor and major. Works only with `--outdated`.
--highest-minor Considers only the versions with matching major. Works only with `--outdated`.
--source Sources to lookup for latest versions. Works only with `--outdated`.
--config A path to a config file to specify sources. Works only with `--outdated`.
--format Set the report output format.
--output-version The version of report output.
--interactive Allow the command to block and require manual action for operations like authentication.
-v|--verbosity Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
key value
--- -----
localSource localSource
Creating test program
latest version of MyLib and MyDep above should be 1.0.2
Press Enter to continue...:
Further investigation showing some interesting issues:
I'll continue investigating
The root cause here for the test failures is the same as https://github.com/NuGet/Home/issues/12954.
If I change the test cases to run the tests without the relative paths, the test cases work.
"Getting latest .NET Core CLI"
# Pls change the value of below $patchSDKCommand to the patched SDK.
$patchSDKCommand = "E:\dotnet-sdk-7.0.406-win-x64\dotnet.exe"
"Testing the following version of the .NET Core CLI/SDK"
& $patchSDKCommand --version
"Creating test package projects"
& $patchSDKCommand new classlib -n MyLib
& $patchSDKCommand new classlib -n MyDep
& $patchSDKCommand add MyLib/MyLib.csproj reference MyDep/MyDep.csproj
& $patchSDKCommand new sln -n test
& $patchSDKCommand sln add MyLib/MyLib.csproj
& $patchSDKCommand sln add MyDep/MyDep.csproj
& $patchSDKCommand build
"Creating packages"
& $patchSDKCommand msbuild /t:pack /p:version=1.0.1
& $patchSDKCommand msbuild /t:pack /p:version=1.0.2
& $patchSDKCommand msbuild /t:pack /p:version=1.0.3-beta
& $patchSDKCommand msbuild /t:pack /p:version=1.1.0
& $patchSDKCommand msbuild /t:pack /p:version=1.2.0-beta
& $patchSDKCommand msbuild /t:pack /p:version=2.0.0
& $patchSDKCommand msbuild /t:pack /p:version=3.0.0-beta
"Creating nuget.config"
New-Item .\localSource\ -ItemType Directory | Out-Null
& $patchSDKCommand new nugetconfig
$xml = [xml](Get-Content .\nuget.config)
$sources = $xml.SelectSingleNode('/configuration/packageSources')
$sources.RemoveAll()
$source = $xml.CreateElement('add')
$source.SetAttribute('key', 'localSource') | Out-Null
$source.SetAttribute('value', 'localSource') | Out-Null
$sources.AppendChild($source)
$source = $xml.CreateElement('add')
if (Test-Path .\cli\sdk\NuGetFallbackFolder) {
$source.SetAttribute('key', 'dotnetFallbackFolder') | Out-Null
$source.SetAttribute('value', 'cli/sdk/NuGetFallbackFolder') | Out-Null
$sources.AppendChild($source)
}
$config = $xml.CreateElement('config')
$xml.DocumentElement.AppendChild($config) | Out-Null
$globalPackagesFolder = $xml.CreateElement('add')
$globalPackagesFolder.SetAttribute('key', 'globalPackagesFolder')
$globalPackagesFolder.SetAttribute('value', 'globalPackages')
$config.AppendChild($globalPackagesFolder) | Out-Null
$xml.Save((Join-Path (Get-Location) nuget.config))
Copy-Item *\bin\Debug\*.nupkg .\localSource\ | Out-Null
"Creating test program"
$cwd = $(pwd).Path
& $patchSDKCommand new console -n MyProg
& $patchSDKCommand add MyProg\MyProg.csproj package MyLib -v 1.0.0
& $patchSDKCommand restore MyProg\MyProg.csproj
& $patchSDKCommand new console -n deprecationTest
& $patchSDKCommand add .\deprecationTest\deprecationTest.csproj package NuGet.Core -v 2.14.0
& $patchSDKCommand list $cwd\MyProg\MyProg.csproj package --outdated --include-transitive --highest-patch
"latest version of MyLib and MyDep above should be 1.0.2"
Pause
& $patchSDKCommand list $cwd\MyProg\MyProg.csproj package --outdated --include-transitive --highest-patch --include-prerelease
"latest version of MyLib and MyDep above should be 1.0.3-beta"
Pause
& $patchSDKCommand list $cwd\MyProg\MyProg.csproj package --outdated --include-transitive --highest-minor
"latest version of MyLib and MyDep above should be 1.1.0"
Pause
& $patchSDKCommand list $cwd\MyProg\MyProg.csproj package --outdated --include-transitive --highest-minor --include-prerelease
"latest version of MyLib and MyDep above should be 1.2.0-beta"
Pause
& $patchSDKCommand list $cwd\MyProg\MyProg.csproj package --outdated --include-transitive
"latest version of MyLib and MyDep above should be 2.0.0"
Pause
& $patchSDKCommand list $cwd\MyProg\MyProg.csproj package --outdated --include-transitive --include-prerelease
"latest version of MyLib and MyDep above should be 3.0.0-beta"
Pause
& $patchSDKCommand list .\deprecationTest\deprecationTest.csproj package --deprecated
"the deprecated package version of deprecationTest above should be 2.14.0"
Pause
"testing complete with the following version of the .NET Core CLI/SDK"
& $patchSDKCommand --version
& $patchSDKCommand new classlib -n MultiTargetTest
$xml=@'
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
<PackageReference Include="Moq" Version="4.10.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="xunit" Version="2.4.0" />
</ItemGroup>
</Project>
'@
Out-File -FilePath .\MultiTargetTest\MultiTargetTest.csproj -InputObject $xml
& $patchSDKCommand restore MultiTargetTest\MultiTargetTest.csproj
& $patchSDKCommand list MultiTargetTest\MultiTargetTest.csproj package
"The output above should have two target frameworks, netstandard1.3 and netstandard2.0"
"Moq should be listed under netstandard1.3, but not netstandard2.0"
"xunit should be listed under netstandard2.0, but not netstandard1.3"
"Newtonsoft.Json should be listed under both"
@v-luzh When was the last time these tests were run?
@v-luzh
I have updated the patch tool and have added instructions about choosing the appropriate version of the SDK to test against.
https://github.com/NuGet/Entropy/tree/main/SDKPatchTool
Let me know what you think, and whether the descriptions are good enough.
Hi @nkolev92, we used .\SDKPatch.ps1 -SDKPath /home/jamie/Desktop/PatchedSDK/ -NupkgsPath /home/jamie/Desktop/nupkgs/ -SDKChannel 8.0.3xx -Quality daily
when patching with NuGet Client Dev\6.10.0.20 today. It works well. Shall we use the -SDKChannel 8.0.3xx
when patching with NuGet Client Dev latest build going forward?
As long as we have 6.10, you should use 8.0.3xx. If we get to 6.11, and the next release is not November, it'll be 8.0.4xx.
Note that there's a chance that 8.0.4xx takes some time to exist after we move to 6.11. This is normal, and should not be a cause for concern. It's something that would normally be resolved within a week or 2.
I updated the script & guidance for picking a version to test against.
If you run the tests right now, https://github.com/NuGet/Home/issues/12954 is likely to repro.
NuGet Product Used
dotnet.exe
Product Version
.NET SDK Version: 7.0.405
Worked before?
Worked well in .NET SDK Version: 7.0.404
Impact
It's more difficult to complete my work
Repro Steps & Context
Repro Steps:
& $patchSDKCommand list MyProg\MyProg.csproj package --outdated --include-transitive --highest-patch --include-prerelease
"latest version of MyLib and MyDep above should be 1.0.3-beta"
Pause
& $patchSDKCommand list MyProg\MyProg.csproj package --outdated --include-transitive --highest-minor
"latest version of MyLib and MyDep above should be 1.1.0"
Pause
& $patchSDKCommand list MyProg\MyProg.csproj package --outdated --include-transitive --highest-minor --include-prerelease
"latest version of MyLib and MyDep above should be 1.2.0-beta"
Pause
& $patchSDKCommand list MyProg\MyProg.csproj package --outdated --include-transitive
"latest version of MyLib and MyDep above should be 2.0.0"
Pause
& $patchSDKCommand list MyProg\MyProg.csproj package --outdated --include-transitive --include-prerelease
"latest version of MyLib and MyDep above should be 3.0.0-beta"
Pause
& $patchSDKCommand list .\deprecationTest\deprecationTest.csproj package --deprecated
"the deprecated package version of deprecationTest above should be 2.14.0"
Pause
"testing complete with the following version of the .NET Core CLI/SDK"
& $patchSDKCommand --version
& $patchSDKCommand new classlib -n MultiTargetTest $xml=@'
'@
Out-File -FilePath .\MultiTargetTest\MultiTargetTest.csproj -InputObject $xml & $patchSDKCommand restore MultiTargetTest\MultiTargetTest.csproj
& $patchSDKCommand list MultiTargetTest\MultiTargetTest.csproj package
"The output above should have two target frameworks, netstandard1.3 and netstandard2.0"
"Moq should be listed under netstandard1.3, but not netstandard2.0"
"xunit should be listed under netstandard2.0, but not netstandard1.3"
"Newtonsoft.Json should be listed under both" Pause