繁体   English   中英

Visual Studio 从 Debug 目录中删除所有 dll、pdb、xml 文件,并且在我尝试发布应用程序时需要发布 - 如何恢复它们?

[英]Visual Studio deletes all dll, pdb, xml files from Debug directory and requires publishing when I tried to publish application - how to restore them?

I am developing .NET 4.6.1 Console application with NuGet packages in with Visual Studio 2019 Community Edition and VS places all the NuGet-retrieved dll and compiled pdb, xml files in src/Debug directory. 我猜它是默认的。

我的项目成功编译,可以调试和执行。 但后来我试图发布它。 我收到错误消息Error An error occurred while signing: Failed to sign bin\Debug\app.publish\MyApplication.exe. SignTool Error: Invalid option: /fd com.mycompany.myapplication Error An error occurred while signing: Failed to sign bin\Debug\app.publish\MyApplication.exe. SignTool Error: Invalid option: /fd com.mycompany.myapplication and I could see that all the dll, pdb and xml files are deleted from my Debug directory and new directory bin\Debug\app.publish has been created but with the exe file只要。

所以 - 在我尝试发布应用程序后,发生了 2 件坏事:

  1. NuGet 软件包中的 dll 已被删除,因此我无法再运行我的 exe 文件;
  2. 现在,每次我尝试重建项目时,Visual Studio 都会尝试发布应用程序。 并且此发布失败并显示Failed to sign bin\Debug\app.publish\MyApplication.exe. SignTool Error: Invalid option: /fd com.mycompany.myapplication Failed to sign bin\Debug\app.publish\MyApplication.exe. SignTool Error: Invalid option: /fd com.mycompany.myapplication ,因此我什至无法重建我的 exe 文件。

如何将 Rebuild 与发布分离,以及如何在 Rebuild 期间不进行发布? 以及如何从我的 Debug 目录中的 NuGet 包中恢复 dll? 即如何撤消自从我尝试发布应用程序以来开始发生的所有坏事?

我遵循了 https://stackoverflow.com/a/56739494/1375882并使用 sha1RSA 执行了“创建测试证书...”,然后发布和重建都按预期进行,甚至 dll/pdb/xml 文件也会在我的调试目录。 所以,这解决了这个问题,但可能以次优的方式......

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM