솔루션을 project.json에서 .csproj로 마이그레이션 할 때 솔루션의 한 프로젝트에서 마이그레이션이 실패합니다. 주어진vs2017 마이그레이션 실패, ArgumentNullException
오류는 다음과 같습니다 프로젝트가 유사한 project.json의 내용이 모두 성공적으로 마이그레이션 (24 개) 다른 프로젝트를 모두 포함로
Migration failed. Unhandled Exception: System.ArgumentNullException: Value cannot be null. Parameter name: version at NuGet.Versioning.VersionRangeBase.Satisfies(NuGetVersion version, IVersionComparer comparer)
이 오류는 수수께끼입니다. 이 오류를 설명 할 것 project.json에서 아무것도
ms.Lib\ms.Lib.xproj: Could not read post-migration report at 'C:\Users\alexl\AppData\Local\Temp\uf3cu05h.ayd'.
ms.Lib\ms.Lib.xproj: Failed to migrate XProj project ms.Lib. 'dotnet migrate --skip-backup -s -x "C:\Users\alexl\git\vs2017test\eServices\ms.Lib\ms.Lib.xproj" "C:\Users\alexl\git\vs2017test\eServices\ms.Lib" -r "C:\Users\alexl\AppData\Local\Temp\uf3cu05h.ayd" --format-report-file-json' exited with error code -532462766.
ms.Lib\ms.Lib.xproj: Migration failed. Unhandled Exception: System.ArgumentNullException: Value cannot be null. Parameter name: version at NuGet.Versioning.VersionRangeBase.Satisfies(NuGetVersion version, IVersionComparer comparer)
at NuGet.Versioning.VersionRangeBase.Satisfies(NuGetVersion version)
at Microsoft.DotNet.ProjectJsonMigration.Rules.MigratePackageDependenciesAndToolsRule.<>c__DisplayClass11_0.<ToPackageDependencyInfo>b__2(VersionRange p) at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate) at Microsoft.DotNet.ProjectJsonMigration.Rules.MigratePackageDependenciesAndToolsRule.ToPackageDependencyInfo(ProjectLibraryDependency dependency, IDictionary`2 dependencyToVersionMap)
at Microsoft.DotNet.ProjectJsonMigration.Rules.MigratePackageDependenciesAndToolsRule.MigrateDependencies(Project project, MigrationRuleInputs migrationRuleInputs, NuGetFramework framework, IEnumerable`1 dependencies, SlnFile solutionFile, ProjectItemGroupElement itemGroup)
at Microsoft.DotNet.ProjectJsonMigration.Rules.MigratePackageDependenciesAndToolsRule.Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs)
at Microsoft.DotNet.ProjectJsonMigration.DefaultMigrationRuleSet.Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs)
at Microsoft.DotNet.ProjectJsonMigration.ProjectMigrator.MigrateProject(MigrationSettings migrationSettings)
at Microsoft.DotNet.ProjectJsonMigration.ProjectMigrator.Migrate(MigrationSettings rootSettings, Boolean skipProjectReferences) at Microsoft.DotNet.Tools.Migrate.MigrateCommand.Execute()
at Microsoft.DotNet.Tools.Migrate.MigrateCommand.<>c__DisplayClass35_0.<Run>b__0()
at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args)
at Microsoft.DotNet.Tools.Migrate.MigrateCommand.Run(String[] args)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
ms.Lib\ms.Lib.xproj: Backing up C:\Users\alexl\git\vs2017test\eServices\ms.Lib\ms.Lib.xproj to C:\Users\alexl\git\vs2017test\eServices\Backup1\ms.Lib.xproj.
ms.Lib\project.json: Backing up C:\Users\alexl\git\vs2017test\eServices\ms.Lib\project.json to C:\Users\alexl\git\vs2017test\eServices\Backup1\project.json.
있습니까 :
이것은 project.json
{
"version": "1.0.0-*",
"dependencies": {
"EPPlus": "4.0.5",
"Microsoft.AspNetCore.Mvc.Abstractions": "1.0.1",
"Microsoft.AspNetCore.Mvc.Core": "1.0.1",
"Microsoft.AspNetCore.Mvc.ViewFeatures": "1.0.1",
"Microsoft.Azure.DocumentDB": "1.11.1",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.1",
"Microsoft.Extensions.Caching.Abstractions": "1.0.0",
"Microsoft.Extensions.Caching.Redis": "1.0.0",
"Microsoft.Extensions.Configuration.Ini": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.IdentityModel.Clients.ActiveDirectory": "3.13.7",
"MongoDB.Driver": "2.3.0",
"NETStandard.Library": "1.6.0",
"RabbitMQ.Client": "4.1.1",
"Sendgrid": "6.3.4",
"System.Collections.Immutable": "1.3.0",
"System.Runtime": "*",
"WindowsAzure.ServiceBus": "3.4.4",
"WindowsAzure.Storage": "8.0.1",
"Unofficial.Ionic.Zip": "1.9.1.8"
},
"frameworks": {
"net461": {
"frameworkAssemblies": {
"System.Drawing": "4.0.0.0"
}
}
}
}
이 전체 오류가 무엇입니까?
고맙습니다. near-boilerplate 앱을 마이그레이션하는 데 30 분 이상 걸렸습니다. – Malachi
'System.Runtime'에 국한되지 않고 'System.Xml.Linq'와'System.Linq'을 모두 사용했습니다. Nuget에서 '현재'버전을 연구하고 와일드 카드를 4.3.0으로 변경하면 마이그레이션이 완료되었습니다. – Aaron