加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

.net core azure部署失败:项目文件不存在

发布时间:2020-12-15 23:33:51 所属栏目:asp.Net 来源:网络整理
导读:我在Azure中设置了一个应用程序服务应用程序,该应用程序设置为部署在一个团队服务git仓库中.这一直运行到现在,并且部署失败: MSBUILD : error MSB1009: Project file does not exist. 但是,如果我将azure控制台和CD打开到我的项目目录,我可以看到项目文件(
我在Azure中设置了一个应用程序服务应用程序,该应用程序设置为部署在一个团队服务git仓库中.这一直运行到现在,并且部署失败:
MSBUILD : error MSB1009: Project file does not exist.

但是,如果我将azure控制台和CD打开到我的项目目录,我可以看到项目文件(一个asp.net核心.xproj)确实存在.我在部署日志的输出中知道它在正确的目录中,显示正在恢复的包:

Command: "D:homesitedeploymentstoolsdeploy.cmd"
Handling ASP.NET Core Web Application deployment.
Restoring packages for D:homesiterepositoryIDPTestsrcIDPTestproject.json...
Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in D:homesiterepositoryIDPTestsrcIDPTestproject.json...
Committing restore...
Lock file has not changed. Skipping lock file write. Path: D:homesiterepositoryIDPTestsrcIDPTestproject.lock.json
D:homesiterepositoryIDPTestsrcIDPTestproject.json
Restore completed in 10549ms.
Restoring packages for D:homesiterepositoryIDPTestsrcIDPTest.MVCClientproject.json...
Restoring packages for tool 'BundlerMinifier.Core' in D:homesiterepositoryIDPTestsrcIDPTest.MVCClientproject.json...
Restoring packages for tool 'Microsoft.AspNetCore.Razor.Tools' in D:homesiterepositoryIDPTestsrcIDPTest.MVCClientproject.json...
Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in D:homesiterepositoryIDPTestsrcIDPTest.MVCClientproject.json...
Committing restore...
Lock file has not changed. Skipping lock file write. Path: D:homesiterepositoryIDPTestsrcIDPTest.MVCClientproject.lock.json
D:homesiterepositoryIDPTestsrcIDPTest.MVCClientproject.json
Restore completed in 7119ms.

NuGet Config files used:
    C:DWASFilesSites#1IDPTestAppDataNuGetNuGet.Config

Feeds used:
    https://api.nuget.org/v3/index.json
Microsoft (R) Build Engine version 15.1.0.0
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1009: Project file does not exist.
Switch: D:homesiterepositoryIDPTestsrcIDPTest.MVCClient
Failed exitCode=1,command=dotnet publish "D:homesiterepositoryIDPTestsrcIDPTest.MVCClient" --output "D:localTemp8d40eb8007743fd" --configuration Release
An error has occurred during web site deployment.
rnD:Program Files (x86)SiteExtensionsKudu59.51109.2534binScriptsstarter.cmd "D:homesitedeploymentstoolsdeploy.cmd

有趣的是,我有两个应用服务应用程序指向同一解决方案中的不同项目.即使他们正在部署不同的项目,他们也会出现同样的错误消息

任何帮助非常感谢.

谢谢

编辑

我已经在我的解决方案根目录中有一个global.json(与.sln文件位于同一级别),但是它指向了较旧版本的SDK,所以我更新了这一点,没有任何区别.然后,我尝试摆脱json文件中的’test’项目,也没有任何区别.仍然失败与相同的error

解决方法

显然,您需要在global.json中明确指定SDK版本,否则Kudu正在使用最新的,现在是预览3,不兼容.
{
"projects": [ "src","test" ],"sdk": {
    "version": "1.0.0-preview2-1-003177"
    }
}

注意,您的global.json文件应该位于您的存储库的根目录.

详细信息:https://social.msdn.microsoft.com/Forums/en-US/2a301f82-6a7a-4c03-ad4a-bd8714d72ba6/continious-deployment-of-aspnet-core-app-suddenly-starts-to-fail-today?forum=windowsazurewebsitespreview&prof=required

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读