如何更改 VS 2017 RC .csproj 项目的目标框架(从核心到经典)? [英] How to change VS 2017 RC .csproj project's target framework (from core to classic)?

查看:13
本文介绍了如何更改 VS 2017 RC .csproj 项目的目标框架(从核心到经典)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在新的核心 aspcsproj"项目中使用 VS 2017 RC 更改目标框架?

我的意思是在项目创建后进行更改.在 VS 2015 中没有用于该项目的 project.json 文件.在目标下拉"的项目属性中,没有其他选项,然后是.NETCoreApp 1.1"和.NETCoreApp 1.0".

详情:我使用yoman生成SPA项目:

解决方案

以这种方式编辑 csproj 文件:

<TargetFramework>netcoreapp1.1</TargetFramework>

替换为:

<TargetFramework>net462</TargetFramework><运行时标识符>win7-x86</运行时标识符>

并删除:

然后

dotnet 恢复点网构建

可选:

dotnet 运行

不要从包管理器控制台启动 dotnet run.它开始了,但是用 ctrl c (标准方式)停止网络应用程序变得不可能.

如果 VS F5 不起作用,(适用于 VS 2017 RC,使用 yoman 模板生成的核心服务),则更改:

<OutputType>winexe</OutputType>

<OutputType>Exe</OutputType>

然后重新启动 VS,重建是不够的(启用 F5,对于 VS 2017 RC 也是如此).

How to change target framework with VS 2017 RC in new core asp "csproj" projects?

I mean to change after project was created. There are no project.json file which was used for that in VS 2015. In project properties in targets "pull down" there are no other options then ".NETCoreApp 1.1" and ".NETCoreApp 1.0".

Details: I have used yoman to generate SPA project: http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/

so I was unable to select .NET Framework during the csproj creation. What to do now?

解决方案

Edit csproj file this way:

<TargetFramework>netcoreapp1.1</TargetFramework>

replace with:

<TargetFramework>net462</TargetFramework>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>

and remove:

<PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" />

Then

dotnet restore
dotnet build

Optional:

dotnet run

Do not start dotnet run from Package Manager Console. It starts but it become impossible to stop web app with ctrl c (standard way).

If VS F5 doesn't work, (true for VS 2017 RC, core services generated with yoman templates), then change:

<OutputType>winexe</OutputType>

to

<OutputType>Exe</OutputType>

and restart VS, rebuild is not enough (to enable F5, again true for VS 2017 RC).

这篇关于如何更改 VS 2017 RC .csproj 项目的目标框架(从核心到经典)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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