我设法以这种方式编织组件:
我已将内容复制packages\Fody.xx\
到Assemblies\Fody\
然后我修改了.csproj
指向复制的.targets
文件(接近末尾.csproj
):
<Import Project="$(SolutionDir)\Assemblies\Fody\build\dotnet\Fody.targets" Condition="Exists('$(SolutionDir)\Assemblies\Fody\build\dotnet\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\Assemblies\Fody\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\Assemblies\Fody\build\dotnet\Fody.targets'))" />
</Target>
我怀疑 TFS 维护人员正在将 Nuget 包下载到另一个文件夹中(例如,所有项目的所有 Nuget 包只有一个副本),这意味着这种包无法正常工作。