You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

.NET Core 2.0 Web App发布至Azure失败(VS2017环境)

Troubleshooting Visual Studio 2017 Publish Failure with AggregateException

First, let's recap what you've observed so far:

  • Both Release and Debug configurations compile without explicit errors
  • Setting build verbosity to Diagnostic didn't turn up clear code-related issues
  • .tmp dump files hint at underlying problems, leading you to suspect an internal Visual Studio error
  • The truncated error message you encountered:

2018年5月4日 21:34:44 System.AggregateException: 发生一个或多个错误。---> System.Exception: 因编译错误导致发布失败。查看错误列表获取更多详细信息。--- 内部异常堆栈跟踪结束 --- 在System.Th...

Since your builds succeed but publish fails, this is likely tied to cached data, corrupted settings, or internal VS installation issues. Here are actionable steps to fix it:

  • Clean and Rebuild Your Solution
    Right-click your solution in Solution Explorer → Select Clean, then Rebuild. This clears partial build artifacts that might be interfering with the publish process.

  • Delete Cached Folders
    Close Visual Studio completely, then delete the hidden .vs folder (in your solution root), plus the bin and obj folders for all projects. Reopen VS, rebuild, and try publishing again—these folders often store corrupted cached data that causes unexpected errors.

  • Reset Visual Studio Settings
    Go to Tools → Import and Export Settings → Reset all settings. Save your current settings if you want, then reset to defaults. Corrupted settings can sometimes break publish workflows.

  • Repair Visual Studio Installation
    Open Control Panel → Programs → Find Visual Studio 2017 → Click Change → Select Repair. This fixes any corrupted or missing system files that might be triggering internal exceptions.

  • Get the Full Error Stack Trace
    The truncated error (System.Th...) hides critical details. Go to the Output window, set "Show output from" to Publish, and look for the complete stack trace. You can also check the Windows Event Viewer (under Application logs) for more context about the exception.

  • Publish via Command Line
    Bypass the VS UI by using MSBuild directly. Open a Developer Command Prompt for VS 2017, navigate to your solution folder, and run:

    msbuild YourSolutionName.sln /p:Configuration=Release /p:PublishProfile=YourPublishProfile.pubxml
    

    Replace the placeholders with your actual solution and publish profile names. This helps confirm if the issue is specific to the VS UI.

  • Update Visual Studio 2017
    Make sure you're running the latest update. Go to Help → Check for Updates and install any available patches—Microsoft frequently fixes internal bugs in these updates.

内容的提问来源于stack exchange,提问作者Abhijeet

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 11:06:54