正文
[ASP.NET Core] 建置x86版本 (workaround)
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
前言
本篇文章介绍如何建置ASP.NET Core项目的x86版本输出(workaround),为自己留个纪录也希望能帮助到有需要的开发人员。
- ASP.NET Core官网
步骤
-
首先到微软官网的「.NET Downloads页面」,下载并安装:x64版本的.NET Core SDK、以及x86版本的.NET Core SDK
-
接着使用Visual Studio 2015建立一个新的ASP.NET Core专案。
-
再来编辑ASP.NET Core专案内的「project.json」,在buildOptions区块内加入platform参数设定并且存档。
"buildOptions": {
"platform": "x86",
"emitEntryPoint": true,
"preserveCompilationContext": true
}
-
最后使用命令提示字符,执行下列编译指令来编译ASP.NET Core专案。在这个编译指令中的$(ProjectDir),请替换为「
项目目录
的路径」。
dotnet build "$(ProjectDir)" --configuration Debug --no-dependencies -r win7-x86
-
完成上述步骤后,在项目的bin目录底下,就可以看到ASP.NET Core项目的x86版本输出。
首先到微软官网的「.NET Downloads页面」,下载并安装:x64版本的.NET Core SDK、以及x86版本的.NET Core SDK
接着使用Visual Studio 2015建立一个新的ASP.NET Core专案。
再来编辑ASP.NET Core专案内的「project.json」,在buildOptions区块内加入platform参数设定并且存档。
"buildOptions": {
"platform": "x86",
"emitEntryPoint": true,
"preserveCompilationContext": true
}
最后使用命令提示字符,执行下列编译指令来编译ASP.NET Core专案。在这个编译指令中的$(ProjectDir),请替换为「 项目目录 的路径」。
dotnet build "$(ProjectDir)" --configuration Debug --no-dependencies -r win7-x86
完成上述步骤后,在项目的bin目录底下,就可以看到ASP.NET Core项目的x86版本输出。