NuGet似乎存在一个问题,导致我无法为面向Windows 8.1和Windows Phone 8.1(Profile32)的可移植类库(PCL)生成包。
NuGet版本:2.8.60318.667
我的目录包含一个.csproj文件和一个提供元数据的随附.nuspec。
<?xml version="1.0"?>
<package>
<metadata>
<id>$id$</id>
<version>$version$</version>
<title>$title$</title>
<authors>$author$</authors>
<owners>$author$</owners>
<licenseUrl>https://raw.githubusercontent.com/StevenLiekens/HTTPortable/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/StevenLiekens/HTTPortable</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>$description$</description>
<releaseNotes></releaseNotes>
<copyright>The MIT License (MIT)</copyright>
<tags></tags>
</metadata>
</package>
当我在该目录中运行nuget.exe pack
时,程序崩溃并出现错误。
&GT; nuget pack
Attempting to build package from 'HTTPortable.Tcp.WinRT.csproj'.
Packing files from 'D:\src\HTTPortable\src\HTTPortable.Tcp.WinRT\src\bin\Debug'.
WARNING: Unable to extract metadata from 'HTTPortable.Tcp.WinRT.dll'.
Using 'HTTPortable.Tcp.WinRT.nuspec' for metadata.
The replacement token 'title' has no value.
详细的日志记录显示nuget.exe正在尝试加载一个不存在的程序集。
&GT; nuget pack / verbosity详解
WARNING: Unable to extract metadata from 'HTTPortable.Tcp.WinRT.dll'.
WARNING: System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Runtime, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Runtime, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.ReflectionOnlyLoad(String assemblyString)
at NuGet.AssemblyMetadataExtractor.MetadataExtractor.AssemblyResolver.ReflectionOnlyAssemblyResolve(Object sender, ResolveEventArgs args)
at System.AppDomain.OnReflectionOnlyAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
at System.ModuleHandle.ResolveMethod(RuntimeModule module, Int32 methodToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount)
at System.ModuleHandle.ResolveMethodHandleInternalCore(RuntimeModule module, Int32 methodToken, IntPtr[] typeInstantiationContext, Int32 typeInstCount, IntPtr[] methodInstantiationContext, Int32 methodInstCount)
at System.ModuleHandle.ResolveMethodHandleInternal(RuntimeModule module, Int32 methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.CustomAttributeData..ctor(RuntimeModule scope, CustomAttributeRecord caRecord)
at System.Reflection.CustomAttributeData.GetCustomAttributes(RuntimeModule module, Int32 tkTarget)
at System.Reflection.CustomAttributeData.GetCustomAttributesInternal(RuntimeAssembly target)
at System.Reflection.RuntimeAssembly.GetCustomAttributesData()
at System.Reflection.CustomAttributeData.GetCustomAttributes(Assembly target)
at NuGet.AssemblyMetadataExtractor.MetadataExtractor.GetMetadata(String path)
at NuGet.AssemblyMetadataExtractor.MetadataExtractor.GetMetadata(String path)
at NuGet.AssemblyMetadataExtractor.GetMetadata(String assemblyPath)
at NuGet.AssemblyMetadataExtractor.ExtractMetadata(PackageBuilder builder, String assemblyPath)
at NuGet.Commands.ProjectFactory.CreateBuilder(String basePath)
这对任何人来说都很熟悉吗?