【发布时间】:2017-01-06 09:02:55
【问题描述】:
NuGet 也支持添加对框架程序集的引用。您可以通过 FrameworkReference 项指定它们:
<ItemGroup> <FrameworkReference Include="System.dll" /> <FrameworkReference Include="System.Core.dll" /> </ItemGroup>
但是当我尝试这个(见下文)时,我得到了一个看起来像 ArgumentNullException 的东西——生成的 .nuspec 文件确实包含正确的 <frameworkAssembly> 元素,但是:
1>C:\…\MSBuild\NuProj\NuProj.targets(527,5): error : Value cannot be null. 1>C:\…\MSBuild\NuProj\NuProj.targets(527,5): error : Parameter name: folderName
这是我的.vbproj 文件的一部分:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
…
<PropertyGroup>
<NuProjPath Condition=" '$(NuProjPath)' == '' ">$(MSBuildExtensionsPath)\NuProj\</NuProjPath>
</PropertyGroup>
<Import Project="$(NuProjPath)\NuProj.props" Condition="Exists('$(NuProjPath)\NuProj.props')" />
<PropertyGroup Label="Configuration">
<Id>SomeProject</Id>
<Version>…</Version>
<Title>…</Title>
…
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\SomeProject.vbproj" />
</ItemGroup>
<!-- the next ItemGroup is the one I added manually, as shown in the documentation: -->
<ItemGroup>
<FrameworkReference Include="System.ServiceModel.dll" />
</ItemGroup>
<Import Project="$(NuProjPath)\NuProj.targets" />
</Project>
是我做错了什么,还是 NuProj 的错误?
【问题讨论】:
-
我在命令行上通过
nuget.exe pack构建包含frameworkAssemblies的.nuspec 文件时也遇到了这个问题。我发现这个问题的唯一其他参考是:github.com/NuGet/Home/issues/2648
标签: nuget-package nuget-spec assembly-references nuproj