从视觉工作室2022到Azure发布ASP.NET核心应用程序不在不查看Web.config的情况下工作

发布于 2025-02-12 03:48:30 字数 169 浏览 2 评论 0原文

当我尝试将我的ASP.NET Core App从VS 2022(最新版本)发布到Azure时,如果未查看项目web.config文件,则发布失败。

手动查看此文件后,发布作品。

如果没有手动步骤,我该如何使出版工作? (我不能切换到github,也无法使用连续发布)

When I try to publish my ASP.NET Core app from VS 2022 (latest version) to Azure, the publishing fails in case the projects web.config file is not checked out.

After manually checking out this file, publishing works.

How can I make publishing work without the manual step? (I can not switch to github and I can not use continuous publishing)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

听,心雨的声音 2025-02-19 03:48:30

我看到您在其他地方提到了此问题,并提供了下面的详细信息。

“ C:\ Program Files \ dotnet \ sdk \ 6.0.202 \ sdks \ Microsoft.net.sdk.sdk.sdk.publish \ targets \ transformTargets \ Microsoft.net.sdk.publish.publish.transish.transformfiles.transformfiles.target.targets.targets(50,5,5):错误MSB4018:“转换WebConfig”任务意外失败。
system.unauthorizedAccessexception:访问路径'c:\ workspaces \ webloces.core \ webesites \ www.die.de.de \ obj \ obj \ repares \ net6.0 \ pubtmp \ ut \ ut \ ut \ web.config'

在发布应用程序时 。 ,转换任务是在Web.config文件上,我认为问题与权限

有关

。发布。

2。 /em>

3。请记住,不要在发布之前删除所有现有文件

<PropertyGroup>
    <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
</PropertyGroup>

相关链接:

“ transformwebconfig”任务意外失败

I see that you have mentioned this issue elsewhere and provided the details below.

"C:\Program Files\dotnet\sdk\6.0.202\Sdks\Microsoft.NET.Sdk.Publish\targets\TransformTargets\Microsoft.NET.Sdk.Publish.TransformFiles.targets(50,5): Error MSB4018: The "TransformWebConfig" task failed unexpectedly.
System.UnauthorizedAccessException: Access to the path 'C:\workspaces\websites.core\websites\www.die.de\obj\Release\net6.0\PubTmp\Out\web.config' is denied."

While publishing the app, a transformation task was running on web.config file. According to the error message, I think the problem is related to permissions.

Suggestion

1. Restart Visual Studio and running it as Administrator, then publish it.

2. I see that your project is on the C drive, check if you have enough permissions to access it, and check if the current web.config file is set to read-only.

3. Also I see a practice, you can try it. You can prevent the generation of web.config files at compile and publish time. Then you can copy and paste the web.config file to wwwroot path manually. Remember not to enable Delete all existing files prior to publish.

<PropertyGroup>
    <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
</PropertyGroup>

Related Link:

The "TransformWebConfig" task failed unexpectedly

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文