0

尝试在单声道上构建 NuGet 并获得:

error CS1744: Named argument `allowPrereleaseVersions' cannot be used for a parameter which has positional argument specified

跑步:

xbuild Build/Build.proj /p:Configuration="Mono Release" /t:GoMono || die

问题:它是什么?是错误还是我做错了什么?

一些分析...

代码 :

    public void InstallPackage(string packageId, SemanticVersion version)
    {
        InstallPackage(packageId, version, ignoreDependencies: false, allowPrereleaseVersions: false);
    }

错误来自:https ://github.com/mono/mono/blob/master/mcs/mcs/ecore.cs#L5324

完整日志:

XBuild Engine 版本 3.2.0.0 Mono,版本 3.2.0.0 版权所有 (C) Marek Sieradzki 2005-2008,Novell 2008-2011。

构建开始于 07/29/2013 09:24:01。 _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ ___项目“/var/tmp/portage/dev-dotnet/nuget-2013.07/work/Build/Build.proj”(GoMono 目标):目标 RestorePackages:项目“/var/tmp/portage/dev-dotnet/nuget -2013.07/work/src/CommandLine/CommandLine.csproj" (Build target(s)): Target PrepareForBuild: Configuration: Mono Release Platform: AnyCPU Created directory "bin/Release/" Created directory "obj/Mono Release/" Target ResolveProjectReferences :项目“/var/tmp/portage/dev-dotnet/nuget-2013.07/work/src/Core/Core.csproj”(默认目标):目标 PrepareForBuild:配置:Mono 发布平台:AnyCPU 创建目录“bin/Release/” 创建目录“obj/Mono Release/” 目标 CopyFilesMarkedCopyLocal:从 '/var/tmp/portage/dev-dotnet/nuget-2013.07/work/lib/ 复制文件Microsoft.Web.XmlTransform.dll' 到 '/var/tmp/portage/dev-dotnet/nuget-2013.07/work/src/Core/bin/Release/Microsoft.Web.XmlTransform.dll' 目标 CopyNonResxEmbeddedResources:从 ' 复制文件/var/tmp/portage/dev-dotnet/nuget-2013。07/work/src/Core/Authoring/nuspec.xsd' 到 '/var/tmp/portage/dev-dotnet/nuget-2013.07/work/src/Core/obj/Mono Release/NuGet.Authoring.nuspec.xsd'目标 GenerateResources:工具 /usr/bin/resgen2 使用参数开始执行:/useSourcePath /compile "../../Common/CommonResources.resx,obj/Mono Release/NuGet.CommonResources.resources" Tool /usr/bin/resgen2以参数开始执行:/useSourcePath /compile "Resources/AnalysisResources.resx,obj/Mono Release/NuGet.Resources.AnalysisResources.resources" 工具 /usr/bin/resgen2 以参数开始执行:/useSourcePath /compile "Resources/NuGetResources.resx,obj/Mono Release/NuGet.Resources.NuGetResources.resources" 目标 GenerateSatelliteAssemblies:没有为目标 GenerateSatelliteAssemblies 指定输入文件,正在跳过。目标 CoreCompile:工具 /usr/bin/dmcs 使用参数开始执行:/noconfig /debug:pdbonly /optimize+ /out:"obj/Mono Release/NuGet.Core.dll" /resource:"obj/Mono Release/NuGet.CommonResources.resources" /resource:"obj/Mono Release/NuGet.Resources.AnalysisResources .resources" /resource:"obj/Mono Release/NuGet.Resources.NuGetResources.resources" /resource:"obj/Mono Release/NuGet.Authoring.nuspec.xsd" 。./../Common/CommonResources.cs ../../Common/CommonAssemblyInfo.cs ../../Common/GlobalSuppressions.cs Analysis/IPackageRule.cs Analysis/PackageIssue.cs Analysis/DefaultPackageRuleSet.cs Analysis/PackageIssueLevel .cs Analysis/Rules/InitScriptNotUnderToolsRule.cs Analysis/Rules/InvalidFrameworkFolderRule.cs Analysis/Rules/MisplacedAssemblyRule.cs Analysis/Rules/MisplacedScriptFileRule.cs Analysis/Rules/MisplacedTransformFileRule.cs Analysis/Rules/MissingSummaryRule.cs Analysis/Rules/WinRTNameIsObsoleteRule。 cs Authoring/AssemblyMetadata.cs Authoring/AssemblyMetadataExtractor.cs Authoring/EmptyFrameworkFolderFile.cs Authoring/IPackageBuilder.cs Authoring/IPropertyProvider.cs Authoring/ManifestDependencySet.cs Authoring/ManifestFrameworkAssembly.cs Authoring/ManifestDependency.cs Authoring/ManifestFile。cs Authoring/ManifestMetadata.cs Authoring/ManifestReader.cs Authoring/ManifestReference.cs Authoring/ManifestReferenceSet.cs Authoring/ManifestSchemaUtility.cs Authoring/ManifestVersionAttribute.cs Authoring/ManifestVersionUtility.cs Authoring/NullPropertyProvider.cs Authoring/PackageDependencySet.cs Authoring/PackageReferenceSet。 cs Authoring/PhysicalPackageAssemblyReference.cs Configuration/ConfigurationDefaults.cs Configuration/SettingsCredentialProvider.cs Configuration/ISettings.cs Configuration/NullSettings.cs Configuration/Settings.cs Configuration/SettingValue.cs EnvironmentVariableWrapper.cs Extensions/CredentialProviderExtensions.cs Extensions/EnumerableExtensions.cs Extensions /ObjectExtensions.cs 扩展/PackageOperationExtensions.cs 扩展/QueryableExtensions.cs 扩展/SettingsExtensions。cs Extensions/TaskExtensions.cs Extensions/VersionExtensions.cs FileModifiers/FileTransformExtensions.cs Http/CredentialStore.cs Http/CredentialType.cs Http/ICredentialCache.cs Http/IHttpWebResponse.cs Http/IProxyCache.cs Http/MultipartWebRequest.cs Http/NullCredentialProvider。 cs Http/ProxyCache.cs Http/RepositoryOperationNames.cs Http/RequestHelper.cs Http/STSAuthHelper.cs Http/WIFTypeProvider.cs IEnvironmentVariableReader.cs IMachineWideSettings.cs Logging/FileConflictResolution.cs Logging/IFileConflictResolver.cs NETPortable/NetPortableProfile.cs NETPortable/NetPortableProfileCollection .cs NETPortable/NetPortableProfileTable.cs PackageRestoreConsent.cs Packages/LocalPackage.cs Packages/OptimizedZipPackage.cs Packages/UnzippedPackage.cs PackageWalker/NuGetVersionNotSatisfiedException。cs ProjectSystem/ProjectImportLocation.cs Repositories/ILatestPackageLookup.cs ProjectSystem/IBatchProcessor.cs Repositories/ICloneableRepository.cs Repositories/ICultureAwareRepository.cs Repositories/IPackageCacheRepository.cs Repositories/IPackageReferenceRepository.cs Repositories/IOperationAwareRepository.cs Repositories/IServiceBasedRepository.cs Repositories cs Repositories/UnzippedPackageRepository.cs Resources/AnalysisResources.Designer.cs SemanticVersion.cs SemanticVersionTypeConverter.cs Server/PackageServer.cs GlobalSuppressions.cs IPackageManager.cs IProjectManager.cs PackageSource/IPackageSourceProvider.cs PackageSource/PackageSourceProvider.cs PackageSource/PackageSourceProviderExtensions.cs Packages/ FrameworkAssemblyReference.cs 包/IFrameworkTargetable.cs 包/IPackageMetadata。cs Packages/IServerPackageMetadata.cs PackageWalker/ConflictResult.cs Repositories/IDependencyResolver.cs PackageWalker/PackageSorter.cs PackageWalker/IPackageOperationResolver.cs PackageWalker/IDependentsResolver.cs PackageWalker/PackageAction.cs PackageWalker/PackageOperation.cs PackageWalker/PackageTargets.cs PackageWalker/PackageWalkInfo。 cs ProjectSystem/NullFileSystem.cs ProjectSystem/PhysicalFileSystem.cs ConstraintProviders/AggregateConstraintProvider.cs Repositories/AggregateQuery.cs Repositories/AggregateRepository.cs ConstraintProviders/DefaultConstraintProvider.cs ConstraintProviders/IPackageConstraintProvider.cs Repositories/IPackageLookup.cs Repositories/MachineCache.cs Repositories/NullConstraintProvider。 cs 存储库/PackageReference.cs 存储库/PackageReferenceFile.cs 实用程序/CredentialResult。cs Utility/CredentialState.cs Utility/CustomAttributeProviderExtensions.cs Utility/DisposableAction.cs Utility/EncryptionUtility.cs Utility/ExceptionUtility.cs Http/HttpUtility.cs Http/ICredentialProvider.cs Http/IHttpClientEvents.cs 存储库/LazyQueue.cs 存储库/ProgressEventArgs。 cs Repositories/SmartDataServiceQuery.cs Repositories/BufferedEnumerable.cs Repositories/DataServiceContextWrapper.cs Repositories/DataServiceQueryWrapper.cs Repositories/ExpressionRewriter.cs Repositories/IDataServiceContext.cs Repositories/IDataServiceQuery.cs Repositories/IPackageRepositoryFactory.cs Repositories/ISharedPackageRepository.cs Repositories/OrderingComparer。 cs Extensions/AppDomainExtensions.cs Extensions/AssemblyNameExtensions.cs Repositories/SharedPackageRepository.cs Runtime/AssemblyBinding。cs Runtime/BindingRedirectManager.cs Runtime/BindingRedirectResolver.cs Runtime/IAssembly.cs Runtime/RemoteAssembly.cs Extensions/CollectionExtensions.cs FileModifiers/Preprocessor.cs FileModifiers/XmlTransfomer.cs Http/IHttpClient.cs Utility/FrameworkNameEqualityComparer.cs Utility/IProgressProvider。 cs Utility/IVersionSpec.cs Utility/MemoryCache.cs Utility/PackageComparer.cs Utility/PackageRepositoryHelper.cs Utility/PackageIdValidator.cs Utility/PathValidator.cs Http/RedirectedHttpClient.cs Utility/ProjectManagerExtensions.cs Utility/ReadOnlyHashSet.cs Utility/VersionSpec。 cs Utility/WebRequestEventArgs.cs FileModifiers/XdtTransformer.cs Logging/NullLogger.cs Logging/ILogger.cs PackageOperationEventArgs.cs Logging/MessageLevel.cs PackageManager.cs Authoring/PhysicalPackageFile.cs Authoring/PackageBuilder。cs Authoring/PathResolver.cs Authoring/Manifest.cs PackageSource/PackageSource.cs Packages/DataServicePackage.cs Packages/DefaultPackagePathResolver.cs Packages/IPackage.cs Packages/IPackagePathResolver.cs ProjectManager.cs FileModifiers/IPackageFileTransformer.cs Repositories/DataServicePackageRepository.cs Utility /HashCodeCombiner.cs Http/HttpClient.cs Utility/PackageDownloader.cs Utility/IHashProvider.cs Utility/PackageEqualityComparer.cs PackageWalker/PackageMarker.cs Packages/ZipPackage.cs Packages/IPackageAssemblyReference.cs Packages/ZipPackageAssemblyReference.cs PackageWalker/PackageWalker.cs PackageWalker /InstallWalker.cs PackageWalker/UpdateWalker.cs PackageWalker/DependentsWalker.cs PackageWalker/UninstallWalker.cs ProjectSystem/IFileSystem.cs Repositories/PackageReferenceRepository。cs Extensions/PackageExtensions.cs Repositories/PackageRepositoryExtensions.cs Extensions/FileSystemExtensions.cs Repositories/PackageRepositoryFactory.cs Resources/NuGetResources.Designer.cs Extensions/ProjectSystemExtensions.cs Utility/PathUtility.cs Utility/QueryableUtility.cs Utility/CryptoHashProvider.cs Extensions/ StreamExtensions.cs Extensions/StringExtensions.cs Utility/PackageHelper.cs Utility/XmlUtility.cs ProjectSystem/IProjectSystem.cs Repositories/PackageRepositoryBase.cs Repositories/IPackageRepository.cs Packages/Constants.cs Packages/IPackageFile.cs Packages/PackageDependency.cs Repositories/ LocalPackageRepository.cs Properties/AssemblyInfo.cs Utility/UriUtility.cs Utility/VersionUtility.cs Extensions/XElementExtensions.cs Packages/ZipPackageFile.cs /target:library /warnaserror+ /define:CODE_ANALYSIS /platform:AnyCPU /reference:../../lib/Microsoft.Web.XmlTransform.dll /reference:/usr/lib/mono/4.0/System.dll /reference:/usr/lib/mono/4.0/ System.ComponentModel.DataAnnotations.dll /reference:/usr/lib/mono/4.0/System.Data.Services.Client.dll /reference:/usr/lib/mono/4.0/System.Runtime.Serialization.dll /reference: /usr/lib/mono/4.0/System.Security.dll /reference:/usr/lib/mono/4.0/System.ServiceModel.dll /reference:/usr/lib/mono/4.0/System.Xml.Linq.dll /reference:/usr/lib/mono/4.0/Microsoft.CSharp.dll /reference:/usr/lib/mono/4.0/System.Xml.dll /reference:/usr/lib/mono/4.0/WindowsBase.dll /参考:/usr/lib/mono/4.0/System.Core.dll /warn:4 PackageManager.cs(97,75):错误 CS1744:命名参数dll /reference:/usr/lib/mono/4.0/System.ComponentModel.DataAnnotations.dll /reference:/usr/lib/mono/4.0/System.Data.Services.Client.dll /reference:/usr/lib/mono /4.0/System.Runtime.Serialization.dll /reference:/usr/lib/mono/4.0/System.Security.dll /reference:/usr/lib/mono/4.0/System.ServiceModel.dll /reference:/usr/ lib/mono/4.0/System.Xml.Linq.dll /reference:/usr/lib/mono/4.0/Microsoft.CSharp.dll /reference:/usr/lib/mono/4.0/System.Xml.dll /reference: /usr/lib/mono/4.0/WindowsBase.dll /reference:/usr/lib/mono/4.0/System.Core.dll /warn:4 PackageManager.cs(97,75):错误 CS1744:命名参数dll /reference:/usr/lib/mono/4.0/System.ComponentModel.DataAnnotations.dll /reference:/usr/lib/mono/4.0/System.Data.Services.Client.dll /reference:/usr/lib/mono /4.0/System.Runtime.Serialization.dll /reference:/usr/lib/mono/4.0/System.Security.dll /reference:/usr/lib/mono/4.0/System.ServiceModel.dll /reference:/usr/ lib/mono/4.0/System.Xml.Linq.dll /reference:/usr/lib/mono/4.0/Microsoft.CSharp.dll /reference:/usr/lib/mono/4.0/System.Xml.dll /reference: /usr/lib/mono/4.0/WindowsBase.dll /reference:/usr/lib/mono/4.0/System.Core.dll /warn:4 PackageManager.cs(97,75):错误 CS1744:命名参数Security.dll /reference:/usr/lib/mono/4.0/System.ServiceModel.dll /reference:/usr/lib/mono/4.0/System.Xml.Linq.dll /reference:/usr/lib/mono/4.0 /Microsoft.CSharp.dll /reference:/usr/lib/mono/4.0/System.Xml.dll /reference:/usr/lib/mono/4.0/WindowsBase.dll /reference:/usr/lib/mono/4.0/ System.Core.dll /warn:4 PackageManager.cs(97,75):错误 CS1744:命名参数Security.dll /reference:/usr/lib/mono/4.0/System.ServiceModel.dll /reference:/usr/lib/mono/4.0/System.Xml.Linq.dll /reference:/usr/lib/mono/4.0 /Microsoft.CSharp.dll /reference:/usr/lib/mono/4.0/System.Xml.dll /reference:/usr/lib/mono/4.0/WindowsBase.dll /reference:/usr/lib/mono/4.0/ System.Core.dll /warn:4 PackageManager.cs(97,75):错误 CS1744:命名参数 allowPrereleaseVersions' cannot be used for a parameter which has positional argument specified PackageManager.cs(100,29): (Location of the symbol related to previous error) PackageManager.cs(97,48): error CS1744: Named argument ignoreDependencies' 不能用于指定了位置参数的参数 PackageManager.cs(100,29):(与先前错误相关的符号位置)任务“Csc”执行 -- FAILED 在项目中完成构建目标“CoreCompile”“/ var/tmp/portage/dev-dotnet/nuget-2013.07/work/src/Core/Core.csproj".-- FAILED Done building project "/var/tmp/portage/dev-dotnet/nuget-2013.07/work/src /Core/Core.csproj".-- FAILED Task "MSBuild" 执行 -- FAILED Done build target "ResolveProjectReferences" in project "/var/tmp/portage/dev-dotnet/nuget-2013.07/work/src/CommandLine/CommandLine.csproj".-- FAILED Done building project "/var/tmp/portage/dev-dotnet/nuget-2013.07/work/ src/CommandLine/CommandLine.csproj".-- 失败的任务 "MsBuild" 执行 -- 在项目 "/var/tmp/portage/dev-dotnet/nuget-2013.07/work/Build/Build. proj".-- 失败完成构建项目 "/var/tmp/portage/dev-dotnet/nuget-2013.07/work/Build/Build.proj".-- 失败执行 -- FAILED Done build target "RestorePackages" in project "/var/tmp/portage/dev-dotnet/nuget-2013.07/work/Build/Build.proj".-- FAILED Done building project "/var/tmp/portage /dev-dotnet/nuget-2013.07/work/Build/Build.proj".--失败执行 -- FAILED Done build target "RestorePackages" in project "/var/tmp/portage/dev-dotnet/nuget-2013.07/work/Build/Build.proj".-- FAILED Done building project "/var/tmp/portage /dev-dotnet/nuget-2013.07/work/Build/Build.proj".--失败

构建失败。错误:

/var/tmp/portage/dev-dotnet/nuget-2013.07/work/Build/Build.proj (GoMono) -> (RestorePackages 目标) -> /var/tmp/portage/dev-dotnet/nuget-2013.07/work/ src/CommandLine/CommandLine.csproj(构建)-> /usr/lib/mono/4.0/Microsoft.Common.targets(ResolveProjectReferences 目标)-> /var/tmp/portage/dev-dotnet/nuget-2013.07/work/src /Core/Core.csproj(默认目标)-> /usr/lib/mono/4.0/Microsoft.CSharp.targets(CoreCompile 目标)->

    PackageManager.cs(97,75): error CS1744: Named argument `allowPrereleaseVersions' cannot be used for a parameter which has

指定位置参数 PackageManager.cs(97,48):错误 CS1744:命名参数“ignoreDependencies”不能用于指定位置参数的参数

     0 Warning(s)
     2 Error(s)
4

1 回答 1

2

是的,这是 mcs 编译器中的一个错误。您可以使用主版本或等待 3.2 更新来解决问题。

于 2013-07-29T14:31:08.567 回答