我有一个应作为x86 Web站点部署在Azure上的ASP.Core RC2项目(使用.NET 4.5.1框架)。从VS发布到Azure时无法更改目标运行时间
上发布的VS设置选项卡中有下列值:
- 目标框架:.NET框架4.5.1
- 目标运行时:推断运行时(WIN7-64)
我想改变的是“Target Runtime”到x86平台的价值,但是这个组合框是无效的(灰色)。
当前project.json:
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.0.1-*",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
},
"buildOptions": {
"emitEntryPoint": true
},
"frameworks": {
"net451": { }
},
"publishOptions": {
"include": [
"appsettings.json",
"project.json",
"web.config",
"NlogWeb.config"
]
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-*",
"imports": "portable-net45+wp80+win8+wpa81+dnxcore50"
}
},
"scripts": {
"postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
}
}
发布您的project.json。你是否有win7-x86的运行时标识符?它应该说是“runtimes”:{“win7-x64”:{},“win7-x86”:{}},'。如果你只有'win7-x64',nuget将不会恢复必要的包(对于独立应用程序https://dotnet.github.io/docs/core-concepts/app-types.html) – Tseng
我已经添加了项目.json内容。没有'运行时'部分,将尝试使用它。 – Set
@Tseng谢谢,添加“运行时间”为我工作。请发表您的评论作为答案,我会接受它。 – Set