在Visual Studio 2015下以x86启动asp.net核心项目 [英] Start an asp.net core project as x86 under visual studio 2015

查看:99
本文介绍了在Visual Studio 2015下以x86启动asp.net核心项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个vs2015解决方案,其中包含一个asp.net核心项目,并按如下方式配置了它的project.json:

I have a vs2015 solution containing an asp.net core project and have configured its project.json as follow :

{
  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true,
    "platform": "x86"
  },
  "runtimes": {
    "win10-x86": {}
  },
  "frameworks": {
    "net461": {}
  },
  "commands": {
    "web": "Microsoft.AspNet.Hosting --ASPNET_ENV production --server Microsoft.AspNet.Server.Kestrel --server.urls http://+:12345",
  }
  [...]
}

我希望该应用程序可以在project.json 中指定的平台上构建和运行(仅供参考,我通过vs2015调试器在win10/x64框上运行该应用程序).但是,改为使用 win7-x64 运行时.我可以看到一个 win7-x64 输出目录,并且启动的提示标题也表明了这一点.

I am expecting the application to build and run with the platform specified in project.json ( FYI, I am running the app via vs2015 debugger on a win10/x64 box ). However, win7-x64 runtime is used instead. I can see a win7-x64 output directory and the prompt title launched indicates it too.

如果我通过指定运行时的命令行直接构建并运行,它将起作用.

If I build and run directly via command line specifying the runtime, it works.

所以我的问题是,我还需要配置什么以从vs2015在x86中启动asp.net核心应用程序?

So my question is, what else do I need to configure to start the asp.net core app in x86 from vs2015 ?

推荐答案

有2个选项:

  1. (全局)卸载64位.net SDK并安装32位.之后重新启动VS.
  2. (本地),将新的.net SDK放在另一个文件夹中,然后从控制台将该路径添加到您的PATH.然后从那里开始VS.它将选择在PATH上找到的第一个dotnet.

这篇关于在Visual Studio 2015下以x86启动asp.net核心项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆