[英]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:要解决此问题,请执行以下步骤:
C:\inetpub
folder (With the folder selected, use the ALT + ENTER shortcut).C:\inetpub
文件夹的属性(选择文件夹后,使用ALT + ENTER快捷方式)。"Full Control"
right for current user and confirm settings by clicking OK button."Full Control"
权限,然后单击“确定”按钮确认设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.