[英]VS 2017 ASP.Net Core Web Application cannot target .Net Framework
I seem to have lost the ability to create an ASP.Net Core Web Application that targets the .Net Framework. 我似乎已经失去了创建针对.Net Framework的ASP.Net Core Web应用程序的能力。 The dropdown is disabled where it used to be enabled.
下拉菜单在以前启用的地方被禁用。
I have .Net 471, 472 SDKs and targeting packs installed and my VS2017 is updated to 15.7.6. 我已经安装了.Net 471、472 SDK和目标包,我的VS2017已更新为15.7.6。
I've tried uninstalling/reinstalling the .Net 4.7x SDKs and targeting packs but that didn't help. 我尝试卸载/重新安装.Net 4.7x SDK和目标包,但这没有帮助。
Is there something short of reinstalling Visual Studio from scratch that I can do? 我可以做些什么从头开始重新安装Visual Studio吗?
The project template only supports .NET Core. 项目模板仅支持.NET Core。 However, once you create the project, you can edit your
.csproj
and change: 但是,一旦创建了项目,就可以编辑
.csproj
并更改:
<TargetFramework>netcoreapp2.1</TargetFramework>
To: 至:
<TargetFramework>net472</TargetFramework>
Save, and you're good to go. 保存,您一切顺利。
It would appear that there are two templates now that can create an ASP.Net Core Web Application. 看来现在有两个模板可以创建ASP.Net Core Web应用程序。
Under .Net Core 在.Net Core下
And under Web 和在网络下
To get the option of selecting to target .Net Core or .Net Framework, you must use the template under Web. 要获得选择以.Net Core或.Net Framework为目标的选项,必须使用Web下的模板。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.