为什么 visual studio 总是重建这个项目?
Why is visual studio always rebuilding this project?
我已经 运行 进入 VS 之前总是重建项目,但打开详细输出通常会立即告诉我它为什么重建。这次我得到了下面的输出,但我无法弄清楚是什么触发了重建,或者“无法解析所有引用的项目”的真正含义或者我能做些什么。
有人知道如何解释这个构建输出以便我可以阻止这个项目一直重建吗?输出还有更多内容,但我只是复制了前 100 行
Build started...
Failed to resolve all items referenced by 'SkyCourt.Tests.Infrastructure\SkyCourt.Tests.Infrastructure.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'WebJobMembershipTypesDaily\WebJobMembershipTypesDaily.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.CourtBookingReports\SkyCourt.Tests.CourtBookingReports.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt\SkyCourt.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.Models\SkyCourt.Tests.Models.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.ClubService\SkyCourt.Tests.ClubService.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.UI\SkyCourt.UI.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SparkPost\SparkPost.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.App.Automapper\SkyCourt.App.Automapper.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.Api\SkyCourt.Tests.Api.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.App.ViewModels\SkyCourt.App.ViewModels.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.App.Api\SkyCourt.App.Api.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.App.Utilities\SkyCourt.App.Utilities.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.App.Models\SkyCourt.App.Models.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.InterCityLeagues\SkyCourt.Tests.InterCityLeagues.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.ClassLibraries\SkyCourt.Tests.ClassLibraries.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.Helpers.Signalr\SkyCourt.Tests.Helpers.Signalr.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.Helpers.Stripe\SkyCourt.Tests.Helpers.Stripe.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Infrastructure\SkyCourt.Infrastructure.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.ClubTeamLeagues\SkyCourt.Tests.ClubTeamLeagues.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'Resources\CommonResources.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.App\SkyCourt.Tests.App.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
1>------ Build started: Project: SkyCourt.Infrastructure, Configuration: Debug Any CPU ------
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Trying to import C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild$(MSBuildToolsVersion)\Microsoft.Common.props using extensions path C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild
1>Property reassignment: $(MSBuildProjectExtensionsPath)="C:\Users\gregv\source\repos\SquashSpider\SquashSpider\SkyCourt.Infrastructure\obj\" (previous value: "obj\") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Microsoft.Common.props (56,5)
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Trying to import C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild$(MSBuildToolsVersion)\Imports\Microsoft.Common.props\ImportBefore\* using extensions path C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>The "Configuration" property is a global property, and cannot be modified.
1>The "Platform" property is a global property, and cannot be modified.
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>The "Configuration" property is a global property, and cannot be modified.
1>The "Platform" property is a global property, and cannot be modified.
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Property reassignment: $(DefineCommonItemSchemas)="false" (previous value: "true") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Microsoft\VisualStudio\Managed\Microsoft.Managed.DesignTime.targets (12,5)
1>Property reassignment: $(DefineCommonCapabilities)="false" (previous value: "true") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Microsoft\VisualStudio\Managed\Microsoft.Managed.DesignTime.targets (13,5)
1>Property reassignment: $(DefineCommonReferenceSchemas)="false" (previous value: "true") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Microsoft\VisualStudio\Managed\Microsoft.Managed.DesignTime.targets (14,5)
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>The "Configuration" property is a global property, and cannot be modified.
1>The "Platform" property is a global property, and cannot be modified.
1>Property reassignment: $(_DebugSymbolsProduced)="true" (previous value: "false") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets (150,5)
1>Property reassignment: $(_DocumentationFileProduced)="false" (previous value: "true") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets (159,5)
1>The "DevEnvDir" property is a global property, and cannot be modified.
1>The "SolutionName" property is a global property, and cannot be modified.
1>The "SolutionFileName" property is a global property, and cannot be modified.
1>The "SolutionPath" property is a global property, and cannot be modified.
1>The "SolutionDir" property is a global property, and cannot be modified.
1>The "SolutionExt" property is a global property, and cannot be modified.
1>Property reassignment: $(ProcessorArchitecture)="msil" (previous value: "") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets (490,5)
1>Property reassignment: $(DelaySign)="" (previous value: "false") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets (530,5)
1>Property reassignment: $(_SGenGenerateSerializationAssembliesConfig)="Auto" (previous value: "") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets (3530,5)
1>Property reassignment: $(_SGenGenerateSerializationAssembliesConfig)="Off" (previous value: "Auto") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets (3531,5)
1>Property reassignment: $(_CodeAnalysisTreatWarningsAsErrors)="false" (previous value: "") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Microsoft\VisualStudio\v16.0\CodeAnalysis\Microsoft.CodeAnalysis.targets (125,5)
1>Property reassignment: $(PrepareForRunDependsOn)="
1> CopyFilesToOutputDirectory
1> ;RunCodeAnalysis" (previous value: "
1> CopyFilesToOutputDirectory
1> ") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Microsoft\VisualStudio\v16.0\CodeAnalysis\Microsoft.CodeAnalysis.targets (167,9)
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Property reassignment: $(ResolveReferencesDependsOn)="
1>
1> BeforeResolveReferences;
1> AssignProjectConfiguration;
1> ResolveProjectReferences;
1> FindInvalidProjectReferences;
1> ResolveNativeReferences;
1> ResolveAssemblyReferences;
1> GenerateBindingRedirects;
1> ResolveComReferences;
1> AfterResolveReferences
1> ;
1> ImplicitlyExpandDesignTimeFacades
1> " (previous value: "
1> BeforeResolveReferences;
1> AssignProjectConfiguration;
1> ResolveProjectReferences;
1> FindInvalidProjectReferences;
1> ResolveNativeReferences;
1> ResolveAssemblyReferences;
1> GenerateBindingRedirects;
1> ResolveComReferences;
1> AfterResolveReferences
1> ") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Bin\Microsoft.NETFramework.CurrentVersion.targets (75,5)
1>Property reassignment: $(PrepareResourceNamesDependsOn)="
1> AssignWinFXEmbeddedResource;
1>
1> AssignTargetPaths;
1> SplitResourcesByCulture;
1> CreateManifestResourceNames;
1> CreateCustomManifestResourceNames
1>
1> " (previous value: "
1> AssignTargetPaths;
1> SplitResourcesByCulture;
1> CreateManifestResourceNames;
1> CreateCustomManifestResourceNames
1> ") at C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets (97,7)
更新
在按照 Perry 的建议执行更新包 - 重新安装并打开诊断输出(我以为我有)之后,我可以看到项目重建的真正原因是:
1>Project 'SkyCourt.Tests.Helpers.MVC' is not up to date. CopyLocal reference 'C:\Users\gregv\source\repos\SquashSpider\SquashSpider\SkyCourt.Tests.Helpers.MVC\bin\Debug\System.Security.Cryptography.Algorithms.dll' is missing from output location.
奇怪的是这个项目安装了System.Security.Cryptography.Algorithms。在引用中,CopyLocal 标志为真。
这个 dll 应该在我的磁盘上的什么地方,它应该被复制到哪里?
看来我需要这个包,因为System.Net.Http需要它并把它拉进来了。
最终更新
我相信这种持续的重建开始是因为在我的一个项目中,编译器建议我需要添加 System.Net.Http 以满足对 HTTP 上下文的引用。但是,这是错误的做法,会导致 DLL 未复制到输出目录的情况之一。相反,我应该添加对 Microsoft.AspNet.WebApi 的引用。当我这样做时,它解决了那个问题。 Here 是对帮助我找到答案的 SO 答案的引用。
然后许多其他项目引用了 System.Data(我可以从 NuGet 包管理器中删除)和一些其他 System.* 组件,这些组件实际上是由 mscor.lib 或其他东西提供的像那样。这是一个非常乏味的过程,一遍又一遍地构建,启用诊断输出以查看丢失了哪些 dll,然后弄清楚如何处理每个 dll。诊断输出导致构建至少慢 5 倍。
最后一件事,如果您发现在 运行 时间内找不到这些 Dll,可能是由于 this。对于 GitHub 问题列表中的 dll,您需要删除 app.config 中可能存在的任何绑定重定向。这些 dll 现在是 .Net 的一部分,不再作为单独的 dll 提供。
正如我的评论所说:
根据描述,请仔细检查您的项目引用、nuget 包引用和程序集相互引用。问题是其中一个已经丢失,导致无法找到 dll。所以重建一直在进行。
所以请尝试以下步骤:
1)进入工具-->选项-->Nuget Package Manager-->General然后勾选这两个选项
2)如果你的项目有任何非sdk net framework项目,你必须运行工具[=69=下的这些命令]-->Nuget 包管理器-->包管理器控制台:
update-package -reinstall
3)检查你的解决方案下的所有项目,确保项目引用都存在,或者你可以删除项目引用,然后重新添加。
还有,请检查Add Reference下是否有汇编dll,请确保它们存在并使用正确的hintpath
。此外,请确保您没有引用任何废弃的 nuget 包。
之后,首先重新构建您的解决方案。然后点击Build查看是否为up-to-date
.
此外,如果你想查看重建的原因,你可以将Build Project输出日志设置为Diagnostic。像这样:
最终更新------由于 dll 问题
我相信这种持续的重建开始是因为在我的一个项目中,编译器建议我需要添加 System.Net.Http
以满足对 HTTP 上下文的引用。但是,这是错误的做法,会导致 DLL 未复制到输出目录的情况之一。相反,我应该添加对 Microsoft.AspNet.WebApi
的引用。当我这样做时,它解决了那个问题。 Here 是对帮助我找到答案的 SO 答案的引用。
然后许多其他项目引用了 System.Data
(我可以从 NuGet 包管理器中删除)和一些其他 System.* 组件,这些组件实际上是由 mscor.lib 或其他东西提供的像那样。这是一个非常乏味的过程,通过启用 Diagnostic 输出来一遍又一遍地构建以查看缺少哪些 dll,然后弄清楚如何处理每个 dll。诊断输出导致构建至少慢 5 倍。
最后一件事,如果您发现在 运行 时间内找不到这些 Dll,可能是由于 this。对于 GitHub 问题列表中的 dll,您需要删除 app.config 中可能存在的任何绑定重定向。这些 dll 现在是 .Net
的一部分,不再作为单独的 dll 提供。
我 运行 在将 Net5 xunit 测试项目添加到以前仅包含 Framework 4.8 项目(具有旧版 .csproj 格式)的解决方案后,我 运行 进入“无法解析 .csproj 中引用的所有项目”。
主项目使用 nuget.config 指向解决方案级别的 .nuget 目录(通过“repositoryPath”键)——它一直运行良好。同时,测试项目使用我的 Windows 配置文件文件夹中的默认包文件夹。
在解决方案的 nuget.config 中为测试项目添加另一个条目(通过“globalPackagesFolder”键)将两个项目设置为在同一位置查找包,并且警告消失了。
不完全确定发生了什么,但似乎有些地方变得混乱了。现在一切都好。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositoryPath" value=".nuget" />
<add key="globalPackagesFolder" value=".nuget" />
</config>
</configuration>
我已经 运行 进入 VS 之前总是重建项目,但打开详细输出通常会立即告诉我它为什么重建。这次我得到了下面的输出,但我无法弄清楚是什么触发了重建,或者“无法解析所有引用的项目”的真正含义或者我能做些什么。
有人知道如何解释这个构建输出以便我可以阻止这个项目一直重建吗?输出还有更多内容,但我只是复制了前 100 行
Build started...
Failed to resolve all items referenced by 'SkyCourt.Tests.Infrastructure\SkyCourt.Tests.Infrastructure.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'WebJobMembershipTypesDaily\WebJobMembershipTypesDaily.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.CourtBookingReports\SkyCourt.Tests.CourtBookingReports.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt\SkyCourt.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.Models\SkyCourt.Tests.Models.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.ClubService\SkyCourt.Tests.ClubService.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.UI\SkyCourt.UI.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SparkPost\SparkPost.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.App.Automapper\SkyCourt.App.Automapper.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.Api\SkyCourt.Tests.Api.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.App.ViewModels\SkyCourt.App.ViewModels.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.App.Api\SkyCourt.App.Api.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.App.Utilities\SkyCourt.App.Utilities.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.App.Models\SkyCourt.App.Models.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.InterCityLeagues\SkyCourt.Tests.InterCityLeagues.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.ClassLibraries\SkyCourt.Tests.ClassLibraries.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.Helpers.Signalr\SkyCourt.Tests.Helpers.Signalr.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.Helpers.Stripe\SkyCourt.Tests.Helpers.Stripe.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Infrastructure\SkyCourt.Infrastructure.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.ClubTeamLeagues\SkyCourt.Tests.ClubTeamLeagues.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'Resources\CommonResources.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
Failed to resolve all items referenced by 'SkyCourt.Tests.App\SkyCourt.Tests.App.csproj'. This message can typically be ignored. The issue may be resolved by fully restoring and building the solution. If the unresolved item is a project reference this can lead to an incomplete NuGet restore result and missing package references. To ensure that restore is able to find all projects verify that all projects are referenced correctly and exist on disk.
1>------ Build started: Project: SkyCourt.Infrastructure, Configuration: Debug Any CPU ------
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Trying to import C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild$(MSBuildToolsVersion)\Microsoft.Common.props using extensions path C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild
1>Property reassignment: $(MSBuildProjectExtensionsPath)="C:\Users\gregv\source\repos\SquashSpider\SquashSpider\SkyCourt.Infrastructure\obj\" (previous value: "obj\") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Microsoft.Common.props (56,5)
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Trying to import C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild$(MSBuildToolsVersion)\Imports\Microsoft.Common.props\ImportBefore\* using extensions path C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>The "Configuration" property is a global property, and cannot be modified.
1>The "Platform" property is a global property, and cannot be modified.
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>The "Configuration" property is a global property, and cannot be modified.
1>The "Platform" property is a global property, and cannot be modified.
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Property reassignment: $(DefineCommonItemSchemas)="false" (previous value: "true") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Microsoft\VisualStudio\Managed\Microsoft.Managed.DesignTime.targets (12,5)
1>Property reassignment: $(DefineCommonCapabilities)="false" (previous value: "true") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Microsoft\VisualStudio\Managed\Microsoft.Managed.DesignTime.targets (13,5)
1>Property reassignment: $(DefineCommonReferenceSchemas)="false" (previous value: "true") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Microsoft\VisualStudio\Managed\Microsoft.Managed.DesignTime.targets (14,5)
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>The "Configuration" property is a global property, and cannot be modified.
1>The "Platform" property is a global property, and cannot be modified.
1>Property reassignment: $(_DebugSymbolsProduced)="true" (previous value: "false") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets (150,5)
1>Property reassignment: $(_DocumentationFileProduced)="false" (previous value: "true") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets (159,5)
1>The "DevEnvDir" property is a global property, and cannot be modified.
1>The "SolutionName" property is a global property, and cannot be modified.
1>The "SolutionFileName" property is a global property, and cannot be modified.
1>The "SolutionPath" property is a global property, and cannot be modified.
1>The "SolutionDir" property is a global property, and cannot be modified.
1>The "SolutionExt" property is a global property, and cannot be modified.
1>Property reassignment: $(ProcessorArchitecture)="msil" (previous value: "") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets (490,5)
1>Property reassignment: $(DelaySign)="" (previous value: "false") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets (530,5)
1>Property reassignment: $(_SGenGenerateSerializationAssembliesConfig)="Auto" (previous value: "") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets (3530,5)
1>Property reassignment: $(_SGenGenerateSerializationAssembliesConfig)="Off" (previous value: "Auto") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets (3531,5)
1>Property reassignment: $(_CodeAnalysisTreatWarningsAsErrors)="false" (previous value: "") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Microsoft\VisualStudio\v16.0\CodeAnalysis\Microsoft.CodeAnalysis.targets (125,5)
1>Property reassignment: $(PrepareForRunDependsOn)="
1> CopyFilesToOutputDirectory
1> ;RunCodeAnalysis" (previous value: "
1> CopyFilesToOutputDirectory
1> ") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Microsoft\VisualStudio\v16.0\CodeAnalysis\Microsoft.CodeAnalysis.targets (167,9)
1>Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild;$(MSBuildProgramFiles32)\MSBuild
1>Property reassignment: $(ResolveReferencesDependsOn)="
1>
1> BeforeResolveReferences;
1> AssignProjectConfiguration;
1> ResolveProjectReferences;
1> FindInvalidProjectReferences;
1> ResolveNativeReferences;
1> ResolveAssemblyReferences;
1> GenerateBindingRedirects;
1> ResolveComReferences;
1> AfterResolveReferences
1> ;
1> ImplicitlyExpandDesignTimeFacades
1> " (previous value: "
1> BeforeResolveReferences;
1> AssignProjectConfiguration;
1> ResolveProjectReferences;
1> FindInvalidProjectReferences;
1> ResolveNativeReferences;
1> ResolveAssemblyReferences;
1> GenerateBindingRedirects;
1> ResolveComReferences;
1> AfterResolveReferences
1> ") at C:\Program Files (x86)\Microsoft Visual Studio19\Community\MSBuild\Current\Bin\Microsoft.NETFramework.CurrentVersion.targets (75,5)
1>Property reassignment: $(PrepareResourceNamesDependsOn)="
1> AssignWinFXEmbeddedResource;
1>
1> AssignTargetPaths;
1> SplitResourcesByCulture;
1> CreateManifestResourceNames;
1> CreateCustomManifestResourceNames
1>
1> " (previous value: "
1> AssignTargetPaths;
1> SplitResourcesByCulture;
1> CreateManifestResourceNames;
1> CreateCustomManifestResourceNames
1> ") at C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets (97,7)
更新
在按照 Perry 的建议执行更新包 - 重新安装并打开诊断输出(我以为我有)之后,我可以看到项目重建的真正原因是:
1>Project 'SkyCourt.Tests.Helpers.MVC' is not up to date. CopyLocal reference 'C:\Users\gregv\source\repos\SquashSpider\SquashSpider\SkyCourt.Tests.Helpers.MVC\bin\Debug\System.Security.Cryptography.Algorithms.dll' is missing from output location.
奇怪的是这个项目安装了System.Security.Cryptography.Algorithms。在引用中,CopyLocal 标志为真。
这个 dll 应该在我的磁盘上的什么地方,它应该被复制到哪里?
看来我需要这个包,因为System.Net.Http需要它并把它拉进来了。
最终更新
我相信这种持续的重建开始是因为在我的一个项目中,编译器建议我需要添加 System.Net.Http 以满足对 HTTP 上下文的引用。但是,这是错误的做法,会导致 DLL 未复制到输出目录的情况之一。相反,我应该添加对 Microsoft.AspNet.WebApi 的引用。当我这样做时,它解决了那个问题。 Here 是对帮助我找到答案的 SO 答案的引用。
然后许多其他项目引用了 System.Data(我可以从 NuGet 包管理器中删除)和一些其他 System.* 组件,这些组件实际上是由 mscor.lib 或其他东西提供的像那样。这是一个非常乏味的过程,一遍又一遍地构建,启用诊断输出以查看丢失了哪些 dll,然后弄清楚如何处理每个 dll。诊断输出导致构建至少慢 5 倍。
最后一件事,如果您发现在 运行 时间内找不到这些 Dll,可能是由于 this。对于 GitHub 问题列表中的 dll,您需要删除 app.config 中可能存在的任何绑定重定向。这些 dll 现在是 .Net 的一部分,不再作为单独的 dll 提供。
正如我的评论所说:
根据描述,请仔细检查您的项目引用、nuget 包引用和程序集相互引用。问题是其中一个已经丢失,导致无法找到 dll。所以重建一直在进行。
所以请尝试以下步骤:
1)进入工具-->选项-->Nuget Package Manager-->General然后勾选这两个选项
2)如果你的项目有任何非sdk net framework项目,你必须运行工具[=69=下的这些命令]-->Nuget 包管理器-->包管理器控制台:
update-package -reinstall
3)检查你的解决方案下的所有项目,确保项目引用都存在,或者你可以删除项目引用,然后重新添加。
还有,请检查Add Reference下是否有汇编dll,请确保它们存在并使用正确的hintpath
。此外,请确保您没有引用任何废弃的 nuget 包。
之后,首先重新构建您的解决方案。然后点击Build查看是否为up-to-date
.
此外,如果你想查看重建的原因,你可以将Build Project输出日志设置为Diagnostic。像这样:
最终更新------由于 dll 问题
我相信这种持续的重建开始是因为在我的一个项目中,编译器建议我需要添加 System.Net.Http
以满足对 HTTP 上下文的引用。但是,这是错误的做法,会导致 DLL 未复制到输出目录的情况之一。相反,我应该添加对 Microsoft.AspNet.WebApi
的引用。当我这样做时,它解决了那个问题。 Here 是对帮助我找到答案的 SO 答案的引用。
然后许多其他项目引用了 System.Data
(我可以从 NuGet 包管理器中删除)和一些其他 System.* 组件,这些组件实际上是由 mscor.lib 或其他东西提供的像那样。这是一个非常乏味的过程,通过启用 Diagnostic 输出来一遍又一遍地构建以查看缺少哪些 dll,然后弄清楚如何处理每个 dll。诊断输出导致构建至少慢 5 倍。
最后一件事,如果您发现在 运行 时间内找不到这些 Dll,可能是由于 this。对于 GitHub 问题列表中的 dll,您需要删除 app.config 中可能存在的任何绑定重定向。这些 dll 现在是 .Net
的一部分,不再作为单独的 dll 提供。
我 运行 在将 Net5 xunit 测试项目添加到以前仅包含 Framework 4.8 项目(具有旧版 .csproj 格式)的解决方案后,我 运行 进入“无法解析 .csproj 中引用的所有项目”。
主项目使用 nuget.config 指向解决方案级别的 .nuget 目录(通过“repositoryPath”键)——它一直运行良好。同时,测试项目使用我的 Windows 配置文件文件夹中的默认包文件夹。
在解决方案的 nuget.config 中为测试项目添加另一个条目(通过“globalPackagesFolder”键)将两个项目设置为在同一位置查找包,并且警告消失了。
不完全确定发生了什么,但似乎有些地方变得混乱了。现在一切都好。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositoryPath" value=".nuget" />
<add key="globalPackagesFolder" value=".nuget" />
</config>
</configuration>