Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Azure Devops找不到还原的nuget软件包_C#_.net_Tfs_Azure Devops - Fatal编程技术网

C# Azure Devops找不到还原的nuget软件包

C# Azure Devops找不到还原的nuget软件包,c#,.net,tfs,azure-devops,C#,.net,Tfs,Azure Devops,我为一个C#项目创建了一个构建管道 我引用了不同的nuget包,比如EntityFramework和位于提要中的一些自己的包 整个解决方案的构建和运行没有问题 此外,在构建管道中,nuget还原也在工作。但是构建失败了,因为它找不到nuget包 这种情况发生在公共包(如EntityFramework)上,也发生在我脚上的包上 nuget版本: 检测到NuGet版本4.1.0.2450/4.1.0 我使用构建版本、构建代理或创建了自己的nuget.config文件 我还卸载了nuget软件包,

我为一个C#项目创建了一个构建管道

我引用了不同的nuget包,比如EntityFramework和位于提要中的一些自己的包

整个解决方案的构建和运行没有问题

此外,在构建管道中,nuget还原也在工作。但是构建失败了,因为它找不到nuget包

这种情况发生在公共包(如EntityFramework)上,也发生在我脚上的包上

nuget版本:

  • 检测到NuGet版本4.1.0.2450/4.1.0
我使用构建版本、构建代理或创建了自己的nuget.config文件

我还卸载了nuget软件包,删除了所有引用并重新安装了每个软件包

例如:

##[error]paybla.Repository.EntityFramework\RepositoryBase.cs(3,19): Error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
RepositoryBase.cs(3,19): error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[error]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(3,19): Error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
UnitOfWorkBase.cs(3,19): error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[error]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(4,19): Error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
UnitOfWorkBase.cs(4,19): error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[error]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(5,19): Error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
UnitOfWorkBase.cs(5,19): error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[error]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(6,19): Error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
UnitOfWorkBase.cs(6,19): error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[error]paybla.Repository.EntityFramework\RepositoryBase.cs(11,26): Error CS0246: The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)
RepositoryBase.cs(11,26): error CS0246: The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[error]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(15,26): Error CS0246: The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)
UnitOfWorkBase.cs(15,26): error CS0246: The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[error]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(157,19): Error CS0246: The type or namespace name 'IDbSet<>' could not be found (are you missing a using directive or an assembly reference?)
UnitOfWorkBase.cs(157,19): error CS0246: The type or namespace name 'IDbSet<>' could not be found (are you missing a using directive or an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
Done Building Project "d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj" (default targets) -- FAILED.
##[error]paybla.Repository.EntityFramework\RepositoryBase.cs(3,19):错误CS0234:命名空间“System.Data”中不存在类型或命名空间名称“Entity”(是否缺少程序集引用?)
RepositoryBase.cs(3,19):错误CS0234:命名空间“System.Data”中不存在类型或命名空间名称“Entity”(是否缺少程序集引用?[d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[错误]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(3,19):错误CS0234:命名空间“System.Data”中不存在类型或命名空间名称“Entity”(是否缺少程序集引用?)
UnitOfWorkBase.cs(3,19):错误CS0234:命名空间“System.Data”中不存在类型或命名空间名称“Entity”(是否缺少程序集引用?[d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[错误]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(4,19):错误CS0234:命名空间“System.Data”中不存在类型或命名空间名称“Entity”(是否缺少程序集引用?)
UnitOfWorkBase.cs(4,19):错误CS0234:命名空间“System.Data”中不存在类型或命名空间名称“Entity”(是否缺少程序集引用?[d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[错误]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(5,19):错误CS0234:命名空间“System.Data”中不存在类型或命名空间名称“Entity”(是否缺少程序集引用?)
UnitOfWorkBase.cs(5,19):错误CS0234:命名空间“System.Data”中不存在类型或命名空间名称“Entity”(是否缺少程序集引用?[d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[错误]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(6,19):错误CS0234:命名空间“System.Data”中不存在类型或命名空间名称“Entity”(是否缺少程序集引用?)
UnitOfWorkBase.cs(6,19):错误CS0234:命名空间“System.Data”中不存在类型或命名空间名称“Entity”(是否缺少程序集引用?[d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[错误]paybla.Repository.EntityFramework\RepositoryBase.cs(11,26):错误CS0246:找不到类型或命名空间名称“DbContext”(是否缺少using指令或程序集引用?)
RepositoryBase.cs(11,26):错误CS0246:找不到类型或命名空间名称“DbContext”(是否缺少using指令或程序集引用?[d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[错误]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(15,26):错误CS0246:找不到类型或命名空间名称“DbContext”(是否缺少using指令或程序集引用?)
UnitOfWorkBase.cs(15,26):错误CS0246:找不到类型或命名空间名称“DbContext”(是否缺少using指令或程序集引用?[d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[错误]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(157,19):错误CS0246:找不到类型或命名空间名称“IDbSet”(是否缺少using指令或程序集引用?)
UnitOfWorkBase.cs(157,19):错误CS0246:找不到类型或命名空间名称“IDbSet”(是否缺少using指令或程序集引用?[d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
已完成生成项目“d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj”(默认目标)——失败。

请尝试检查您是否已将\packages文件夹添加到源代码管理中,如果是,您可以从源代码管理中删除整个packages文件夹,以查看它是否能解决问题。

可能与您的案例无关,但有时(特别是在允许R#引用缺少的包时)csproj文件可能包含对本地驱动器上的程序集的引用-类似这样

<ItemGroup>
  <Reference Include="name">
    <HintPath>../../your/local/path</HintPath>
  </Reference>
</ItemGroup>

../../your/local/path

删除所有这样的节点并通过nuget ui手动添加包在我的案例中有所帮助

nuget还原在构建管道中也起作用了——是起作用了,还是成功了?这两件事不是一回事;构建活动可以成功,即使它没有做您期望它做的事情。查看恢复日志。它正在恢复所有的包吗?有任何警告吗?这是一个非常好的答案!事实上,我在日志中没有看到任何还原的包。我不知道为什么我没有注意到这一点。。日志末尾的configuration:End链接显示:packages.config中列出的所有软件包都已安装。我是诚实的。。我不知道这里的问题是什么使用您自己的构建代理来重现问题,然后您可以转到实际工作目录进行进一步分析。在互联网上讨论此类内容太广泛了。您使用的是Nuget还原还是dotnet还原?