1

根据NuProj 文档

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>…&lt;/Version>
    <Title>…&lt;/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 的错误?

4

1 回答 1

2

这是 Nuget.exe v3.4.3 的一个问题 - 详细信息在此: https ://github.com/NuGet/Home/issues/2648

我能够通过更新到 v3.5.0 来解决这个问题 - 只需> nuget update -self在命令行上运行。

于 2017-03-13T06:26:20.727 回答