Visual Studio项目总是重新编译但PDB文件未更新。

3

我已经开启了详细日志记录。

我总是收到这个:

1>FastUpToDate: Input 'C:\Development\Source\DotNet\common\Bentley.APM.Common.ODBC\obj\project.assets.json' is newer (5/5/2020 8:52:58 AM) than earliest output 'C:\Development\Source\DotNet\bin\x64\Release\Bentley.APM.Common.ODBC.pdb' (5/1/2020 11:17:23 PM), not up to date. (Bentley.APM.Common.ODBC)

在 bin 文件夹里,每次构建后 dll 的时间戳会得到更新。但对应的 pdb 时间戳却是几天前的。我认为只有当我手动编辑项目中那些一直在“重建”的文件之一时,pdb 才会得到更新。这里还有一些看起来令人担忧的输出内容:
Failed to resolve all items referenced by 'Service Providers\Ivara.ServiceProvider.Interoperability\Ivara.ServiceProvider.Interoperability.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 'common\Authentication\Bentley.APM.Authentication.Oidc.Client\Bentley.APM.Authentication.Oidc.Client.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 'common\Authentication\Bentley.APM.Authentication.SSPI\Bentley.APM.Authentication.SSPI.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 'common\Authentication\Bentley.APM.Authentication.Interfaces\Bentley.APM.Authentication.Interfaces.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 'common\Authentication\Bentley.APM.Authentication.Common\Bentley.APM.Authentication.Common.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 'common\IvaraCommon\IvaraCommon.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 'Service Providers\Bentley.APM.ServiceProvider.GraphQL\Bentley.APM.ServiceProvider.GraphQL.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 'Service Providers\Rest.Common\Rest.Common.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 'Service Providers\Ivara.ServiceProvider.Interoperability\Test\Ivara.ServiceProvider.Interoperability.Test.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 'Service Providers\Bentley.APM.ServiceProvider.GraphQL\Tests\Bentley.APM.ServiceProvider.GraphQL.Tests.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 'Service Providers\Bentley.APM.ServiceProvider.GraphQL\UnitTests\Bentley.APM.ServiceProvider.GraphQL.UnitTests.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 'Service Providers\Rest.Common.Tests\Rest.Common.Tests.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 'Service Providers\Ivara.ServiceProvider.MobileRestService\UnitTests\Ivara.ServiceProvider.MobileRestService.UnitTests.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 'Service Providers\Ivara.ServiceProvider.MobileRestService\Test\Ivara.ServiceProvider.MobileRestService.Test.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 'Utilities\ServiceProviderHost\ServiceProviderHost.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 'TestingInfrastructure\TestConfigurationApp\TestSettings.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 'TestingInfrastructure\TestFramework\TestFramework.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.
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at VSLangProj80.Reference3.get_SourceProject()
   at NuGet.PackageManagement.VisualStudio.VsCoreProjectSystemReferenceReader.IsProjectReference(Reference3 reference, ILogger logger)
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at VSLangProj80.Reference3.get_SourceProject()
   at NuGet.PackageManagement.VisualStudio.VsCoreProjectSystemReferenceReader.IsProjectReference(Reference3 reference, ILogger logger)
Failed to resolve all items referenced by 'EXPLink\EXPLinkTestSuiteExtensions\EXPLinkTestSuiteExtensions.vcxproj'. 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 'Service Providers\Ivara.ServiceProvider.MobileRestService\Ivara.ServiceProvider.MobileRestService.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.
Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the NuGet Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
Running restore with 12 concurrent jobs.
Reading project file C:\Development\Source\DotNet\common\Bentley.APM.Common.Extensions\Bentley.APM.Common.Extensions.csproj.

编辑 - 我又回到了这个状态:


1>FastUpToDate: Input 'C:\Development\Source\DotNet\common\Bentley.APM.Common.Logging\obj\project.assets.json' is newer (5/13/2020 5:25:07 AM) than earliest output 'C:\Development\Source\DotNet\common\Bentley.APM.Common.Logging\obj\x64\Release\Bentley.APM.Common.Logging.pdb' (5/11/2020 2:28:57 PM), not up to date. (Bentley.APM.Common.Logging)
1>------ Build started: Project: Bentley.APM.Common.Logging, Configuration: Release x64 ------
1>Target GenerateTargetFrameworkMonikerAttribute:
1>  Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
1>Target CoreGenerateAssemblyInfo:
1>  Skipping target "CoreGenerateAssemblyInfo" because all output files are up-to-date with respect to the input files.
1>Target CoreCompile:
1>  Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
1>Target _CopyFilesMarkedCopyLocal:
1>  Touching "C:\Development\Source\DotNet\common\Bentley.APM.Common.Logging\obj\x64\Release\Bentley.APM.Common.Logging.csproj.CopyComplete".
1>Target ApmUpdateVersion:
1>  C:\Development\Source\DotNet\common\Bentley.APM.Common.Logging\obj\x64\Release\Bentley.APM.Common.Logging.dll : Version resource updated
1>

这将会一次又一次地进行构建:

1>FastUpToDate: Input 'C:\Development\Source\DotNet\common\Bentley.APM.Common.Logging\obj\project.assets.json' is newer (5/13/2020 5:25:07 AM) than earliest output 'C:\Development\Source\DotNet\common\Bentley.APM.Common.Logging\obj\x64\Release\Bentley.APM.Common.Logging.pdb' (5/11/2020 2:28:57 PM), not up to date. (Bentley.APM.Common.Logging)

这个pdb已经超过两天了,看起来没有得到更新。

我认为这是因为

1>Target CoreCompile: 1> Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.

那么问题或者困难是什么? - Alex Guteniev
在Visual Studio中,项目一直在重新构建。对我来说,它看起来是因为pdb不是最新的。但是pdb从几天前开始就没有更新过,时间戳也是如此。如果我去修改项目内的文件,那么pdb会得到更新。但是如果我不这样做,每次构建解决方案时,它都会继续构建大量的项目,但是项目的pdb不会得到更新。 - Derek
在我看来,它似乎一直在重新构建,因为 pdb 不是最新的。我认为你可以通过禁用(暂时)生成 .pdb 来证明或证伪这个理论。 - Alex Guteniev
你尝试过更改调试路径并重新构建吗? - Akshay
首先,为什么会出现这个问题?如果源代码没有更改,为什么*.pdb文件会更改呢?无论如何,您是否采取了标准步骤?1:删除.pdb文件2:重新启动VStudio并进行完整的重建3:重新启动Win* + 步骤#2. 4:删除VStudio解决方案元数据(在解决方案目录中的一个vs dir)? - CristiFati
你的环境相当复杂。你能否用一个较小的(虚拟的)*.csproj(将其添加到解决方案中)来重现它?如果虚拟尝试不可行,那么请发布 csproj(以及 Logging 文件),还有 *.target 文件(们)吗? - CristiFati
2个回答

0
清理解决方案并重新构建,或在构建解决方案之前删除PDB文件应该有效。

-1

你好,尝试删除这个隐藏文件夹 .vs。移除你的引用,清理 bin 文件夹并再次添加引用。然后运行你的程序。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接