在我的TFS构建中,nuget包在预构建脚本中下载并解压缩。
来自nuget的dll的构建引用期间没有得到解决:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1605): Could not resolve this reference. Could not locate the assembly "<asesembly_name>"
我没有将nuget / packages检入TFS源代码控制 - 我认为你不应该这样做。
未解决的参考示例:
<Reference Include="Gestion_Excepciones">
<HintPath>..\..\..\..\packages\Gestion_Excepciones.1.0.0.0\lib\net35\Gestion_Excepciones.dll</HintPath>
</Reference>
构建日志(抱歉,用西班牙语)
Referencia principal“Gestion_Excepciones”。 (TaskId:10)17:22:37.274
2 - ; C:\的Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Microsoft.Common.targets(1605,5): 警告MSB3245:没有se pudo resolver esta referencia。没有se encuentra el ensamblado“Gestion_Excepciones”。 Compruebe si el ensamblado existe en el disco。 Sielcódigaincesitaesta referencia,podríanproducirse erroresdecompilación。 [C:\构建\ 1 \ Egestiona \ eLegisla \ SRC \源\网站\模块\ eLegisla \ asp.net_eLegisla.BussinesLayer.Datos \ asp.net_eLegisla.BussinesLayer.Datos.csproj] 的&GT; Para SearchPath“{HintPathFromItem}”。 (TaskId:10)Se考虑 - “.. \ .. \ .. \ .. \包\ Gestion_Excepciones.1.0.0.0 \ LIB \ net35 \ Gestion_Excepciones.dll” pero noexistía。(TaskId:10)Para SearchPath “{} TargetFrameworkDirectory”。 (TaskId:10)Se考虑 - “C:\ Program 文件\参考 Assemblies \ Microsoft \ Framework \ v3.5 \ Gestion_Excepciones.winmd“,pero 没有存在。 (TaskId:10)Se考虑 - “C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ v3.5 \ Gestion_Excepciones.dll“,pero no existía。 (TaskId:10)Se考虑 - “C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ v3.5 \ Gestion_Excepciones.exe“,pero no existía。 (TaskId:10)......
通过Bing Translator的英文版
主要参考“管理_例外”。 (TaskId:10)17:22:37.274
2&gt;C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5)
:警告MSB3245:
无法解析此引用。大会没有找到“Exceptions_management”。检查磁盘上是否存在程序集。如果代码需要此引用,可能会导致编译错误。[C:\Builds\1\Egestiona\eLegisla\src\source\website\modules\eLegisla\asp.net_eLegisla.BussinesLayer.Datos\asp.net_eLegisla.BussinesLayer.Datos.csproj]
&gt;对于SearchPath“{HintPathFromItem}
”。
(TaskId:10)它被认为是“..\..\..\..\packages\Exceptions_management.1.0.0.0\lib\net35\Exceptions_management.dll
”,但没有。
(TaskId:10)对于SearchPath“{TargetFrameworkDirectory}
”。
(TaskId:10)它被认为是“C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\Exceptions_management.winmd
”,但没有。
(TaskId:10)它被认为是“C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\Exceptions_management.dll
”,但没有。
(TaskId:10)它被认为是“C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\Exceptions_management.exe
”,但没有。
(TaskId:10)......
构建日志显示msbuild被认为是HintPath并且无法找到它 - 但我可以看到它在那里! HintPath不是相对于.csproj目录吗?
我正在使用
MSBuildBinPath = C:\ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319
nuget 2.8.1
2012年TFS
答案 0 :(得分:0)
在TFS 2013源代码管理中检入/ packages,现在正在解析引用。这让我有点沮丧 - afaik nuget raisons d'être之一是你不必检查包(读dll),因为它们存在于他们的包存储库中。