Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow netstandard0.0 as target framework #673

Merged
Merged
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions src/NuGetForUnity.Tests/Assets/Tests/Editor/NuGetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,21 @@ public void InstallBouncyCastleTest([Values] InstallMode installMode)
Assert.That(dllFilePath, Does.Exist.IgnoreDirectories);
}

[Test]
public void InstallPackageWith00DependencyTest()
{
ConfigureNugetConfig(InstallMode.ApiV3Only);

var packageWith00Dependency = new NugetPackageIdentifier("Microsoft.ML.OnnxRuntime", "1.19.2") { IsManuallyInstalled = true };
var expectedDependency = new NugetPackageIdentifier("Microsoft.ML.OnnxRuntime.Managed", "1.19.2");

NugetPackageInstaller.InstallIdentifier(packageWith00Dependency);

// Microsoft.ML.OnnxRuntime depends on Microsoft.ML.OnnxRuntime.Managed, so they should both be installed
Assert.That(InstalledPackagesManager.InstalledPackages, Does.Contain(packageWith00Dependency));
Assert.That(InstalledPackagesManager.InstalledPackages, Does.Contain(expectedDependency));
}

[Test]
[TestCase("1.0.0-rc1", "1.0.0")]
[TestCase("1.0.0-rc1", "1.0.0-rc2")]
Expand Down
6 changes: 6 additions & 0 deletions src/NuGetForUnity/Editor/TargetFrameworkResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ internal static class TargetFrameworkResolver
new TargetFrameworkSupport("net35", null, DotnetVersionCompatibilityLevel.NetFramework46Or48),
new TargetFrameworkSupport("net20", null, DotnetVersionCompatibilityLevel.NetFramework46Or48),
new TargetFrameworkSupport("net11", null, DotnetVersionCompatibilityLevel.NetFramework46Or48),
new TargetFrameworkSupport("net00", null, DotnetVersionCompatibilityLevel.NetFramework46Or48),

// .net standard
new TargetFrameworkSupport(
Expand Down Expand Up @@ -102,6 +103,11 @@ internal static class TargetFrameworkResolver
null,
DotnetVersionCompatibilityLevel.NetStandard20Or21,
DotnetVersionCompatibilityLevel.NetFramework46Or48),
new TargetFrameworkSupport(
"netstandard00",
null,
DotnetVersionCompatibilityLevel.NetStandard20Or21,
DotnetVersionCompatibilityLevel.NetFramework46Or48),

// fallback if there is one with empty string
new TargetFrameworkSupport(string.Empty),
Expand Down
Loading