我在OSX上使用yeoman创建了一个新的dotnet核心MVC应用程序。我做了dotnet restore
& dotnet publish
。然后我把它推到了Github&在azure我添加了Github repo&应该自动将我的网站部署到azure但是我看到了这个错误
dotnet info
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"
答案 0 :(得分:0)
在项目的根目录中添加global.json
HttpContext.Current.Request.Url.Authority