我正在Azure上运行ASP.NET Core(以前的ASP.NET 5)网站。
几个月前我更新了我的站点地图文件,在查看Google网站站长工具时,我注意到我的站点地图中存在一些错误。我检查了GWT显示的内容,发现它来自我以前的版本。
我已经检查了我的BitBucket存储库,看到正确的更新版本存在于那里。
为什么Azure不部署我的更新版本?
编辑:回应下面的评论者......
这是project.json文件:
{
"userSecretsId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Dapper": "1.42.0",
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"Microsoft.ApplicationInsights.AspNet": "1.0.0-rc1",
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-final",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
"Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final",
"Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final",
"HtmlAgilityPack": "1.4.9.5"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"dnx451": {
"dependencies": {
"Microsoft.VisualStudio.QualityTools.UnitTestFramework": "1.0.0-*"
}
}
},
"exclude": [
"wwwroot",
"node_modules"
],
"publishExclude": [
"**.user",
"**.vspscc"
],
"scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
}
}
答案 0 :(得分:2)
因此,您publishOptions
中没有任何project.json
部分,这很奇怪。你应该包括它。例如我看起来像这样,我将你的sitemap.xml
添加到列表中(我不知道你的文件在哪里,所以我认为它在根级别)
"publishOptions": {
"include": [
"wwwroot",
"web.config",
"appsettings.Development.json",
"appsettings.Production.json",
"Views",
"sitemap.xml"
]
}
顺便说一句,你的project.json
看起来很旧,你还在使用RC1。自那时起,RC2出现了RTM 1.0和几天前的版本1.1.0之后,很多事情发生了变化。
我真的建议你升级你的项目,RC1是一个非常早期的版本,你不应该继续使用它。升级它需要一些时间,但这是值得的
答案 1 :(得分:0)
对于ASP.NET Core 2.0,将robots.txt文件添加到wwwroot文件夹