azure - 错误 MSB4025 : The project file could not be loaded. 根级别的数据无效

标签 azure asp.net-core-mvc

我在 OSX 上使用 yeoman 创建了一个新的 dotnet core MVC 应用程序。我做了dotnet恢复dotnet发布。然后我将其推送到 Github,并在 azure 中添加了 Github 存储库,它应该自动将我的网站部署到 azure,但我看到了此错误

dotnet 信息

Product Information:
 Version:            1.0.0-preview2-1-003177
 Commit SHA-1 hash:  a2df9c2576

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.12-x64

日志

Installing Microsoft.VisualBasic 10.0.1.
Installing System.ComponentModel.Annotations 4.1.0.
Restoring packages for tool 'Microsoft.AspNetCore.Razor.Tools' in D:\home\site\repository\project.json...
Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in D:\home\site\repository\project.json...
  GET https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.server.iisintegration.tools/index.json
  OK https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.server.iisintegration.tools/index.json 141ms
  GET https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.server.iisintegration.tools/1.1.0-preview4-final/microsoft.aspnetcore.server.iisintegration.tools.1.1.0-preview4-final.nupkg
  OK https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.server.iisintegration.tools/1.1.0-preview4-final/microsoft.aspnetcore.server.iisintegration.tools.1.1.0-preview4-final.nupkg 22ms
  GET https://api.nuget.org/v3-flatcontainer/microsoft.extensions.commandlineutils/1.1.0/microsoft.extensions.commandlineutils.1.1.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/microsoft.extensions.commandlineutils/1.1.0/microsoft.extensions.commandlineutils.1.1.0.nupkg 25ms
Installing Microsoft.Extensions.CommandLineUtils 1.1.0.
Installing Microsoft.AspNetCore.Server.IISIntegration.Tools 1.1.0-preview4-final.
Committing restore...
Writing lock file to disk. Path: D:\home\site\repository\project.lock.json
D:\home\site\repository\project.json
Restore completed in 240318ms.

NuGet Config files used:
    C:\DWASFiles\Sites\#1ivdstudios\AppData\NuGet\NuGet.Config

Feeds used:
    https://api.nuget.org/v3/index.json

Installed:
    320 package(s) to D:\home\site\repository\project.json
Microsoft (R) Build Engine version 15.1.545.13942
Copyright (C) Microsoft Corporation. All rights reserved.

D:\home\site\repository\project.json(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.
Failed exitCode=1, command=dotnet publish "project.json" --output "D:\local\Temp\8d45033fdf16040" --configuration Release
An error has occurred during web site deployment.
\r\nD:\Program Files (x86)\SiteExtensions\Kudu\59.60207.2684\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

最佳答案

在项目的根目录添加 global.json

{
  "sdk": {
    "version": "1.0.0-preview2-1-003177"
}}

关于azure - 错误 MSB4025 : The project file could not be loaded. 根级别的数据无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42117090/

相关文章:

sql-server - 使用 Azure AD 的凭据进行本地 SQL Server 访问

node.js - 重定向到redirectURL Passport-azure-ad OIDCStrategy

azure - 用于获取带有员工 ID 的整个用户列表的图形 API

c# - 为什么 Visual Studio 不会因未处理的外部异常而中断?

asp.net-core - ASP.Net Core MVC中的DataAnnotationsModelValidatorProvider.RegisterAdapter

c# - 如何从 Controller 返回一个特定的状态码并且没有内容?

asp.net-core - ASP.NET 5 : Error with Nuget package in Class library Package

c# - CosmosDb 使用 insertMany 请求率很大

python-3.x - 将文件保存到 Azure Blob 中

asp.net-core - ASP.NET 5 : How to configure the path of logs in Microsoft. 扩展.日志记录