简体   繁体   English

在 ASP.NET 中发布网站时出现 System.AggregateException 错误

[英]System.AggregateException Error When Publishing Website in ASP.NET

I decided to publish the ASP.NET MVC project to test it locally using IIS Manager .我决定发布ASP.NET MVC项目以使用IIS Manager在本地对其进行测试。 Therefore, after opening the necessary windows features, I created a new folder in the C:\inetpub\ directory on IIS Manager :因此,在打开必要的 windows 功能后,我在IIS 管理器C:\inetpub\目录中创建了一个新文件夹:

在此处输入图像描述

In the Visual Studio IDE I right clicked on the solution and clicked "Publish..." and specified that the target was "Folder" :Visual Studio IDE 中,我右键单击解决方案并单击“发布...”并指定目标是“文件夹”

在此处输入图像描述

When I clicked the Next button, I specified in the next window that the "Target" location was the C.\inetpub\TechnologyArticle directory.当我单击下一步按钮时,我在下一个 window 中指定“目标”位置是C.\inetpub\TechnologyArticle目录。 Then when I clicked the "Publish..." in the Visual Studio IDE , I encountered an error that I did not receive in Debug mode:然后,当我单击Visual Studio IDE中的“发布...”时,我遇到了在Debug模式下没有收到的错误:

System.AggregateException: One or more errors occurred. 
---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed.

---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed.

---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed.

How can I solve this problem?我怎么解决这个问题? Is the reason why I got this error in Release mode , which I did not receive in Debug mode , due to programming?是因为编程导致我在Release 模式下收到此错误,而在Debug 模式下没有收到此错误的原因吗?

This error is not due to programming.此错误不是由于编程造成的。 The reason for this error is trying to publish the website in the C:\inetpub\ directory, which is made visible and/or created by a service that you have activated by "Turn Windows features on or off" to publish the ASP.NET website locally.此错误的原因是尝试在C:\inetpub\目录中发布网站,该目录由您通过“打开或关闭 Windows 功能”激活的服务可见和/或创建以在本地发布 Z9E0DAZ0F438E1E73B8A1CDD3 网站. The user has no right to modify the C:\inetpub\ directory.用户无权修改C:\inetpub\目录。 Therefore, the current user's right to modify the C:\inetpub\ directory must be declared manually in the Windows 10 operating system.因此,当前用户修改C:\inetpub\目录的权限必须在Windows 10操作系统中手动声明。

When the ASP.NET website is published, the project outputs (such as *.dll files, style files, scripts, Views) compiled in Release mode will be extracted to the target directory, so the user must have the right to write to the C:\inetpub directory.当ASP.NET网站发布时,在Release模式下编译的项目输出(如*.dll文件、样式文件、脚本、Views)会被解压到目标目录,所以用户必须有写入C:\inetpub目录。

To resolve this issue, follow the steps below:要解决此问题,请执行以下步骤:

  • Open the properties of the C:\inetpub folder (With the folder selected, use the ALT + ENTER shortcut).打开C:\inetpub文件夹的属性(选择文件夹后,使用ALT + ENTER快捷方式)。
  • Switch to the Security tab and click the Edit button.切换到安全选项卡并单击编辑按钮。
  • Define "Full Control" right for current user and confirm settings by clicking OK button.为当前用户定义"Full Control"权限,然后单击“确定”按钮确认设置。
  • You repeat the publish procedure to publish your website.您重复发布过程以发布您的网站。

在此处输入图像描述

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

相关问题 ASP.NET中GetStringAsync上的System.AggregateException - System.AggregateException on GetStringAsync in asp.net ASP.NET Core MVC 中 Program.cs 中的 System.AggregateException - System.AggregateException in Program.cs in ASP.NET Core MVC 尝试在 ASP.NET CORE 3.1 中注册服务时出现 System.AggregateException 异常 - System.AggregateException exception while attempting to register a service in ASP.NET CORE 3.1 System.AggregateException: '某些服务无法构建" ASP.net 核心 - System.AggregateException: 'Some services are not able to be constructed " ASP.net core System.AggregateException:“无法构建某些服务”在我的 ASP.net 核心中 - System.AggregateException: 'Some services are not able to be constructed' In my ASP.net core System.AggregateException:Azure 无法部署网站 - System.AggregateException: Azure can't deploy website 异常被捕获为System.AggregateException - Exception catched as System.AggregateException System.AggregateException程序崩溃 - System.AggregateException the program crashes 调用 Connection.Start 时 SignalR 中的 System.AggregateException - System.AggregateException in SignalR when calling Connection.Start 与Parallel.Invoke()一起使用时出现System.AggregateException异常 - System.AggregateException exception when using with Parallel.Invoke()
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM