[英]How can I convert a .NET Core project to a .NET Framework project?
I created a "Console App (.NET Core)" project in Visual Studio. 我在Visual Studio中创建了一个“控制台应用程序(.NET Core)”项目。 Now I need to add a dependency that only works on .NET Framework 4.6+, not .NET Core. 现在,我需要添加一个仅适用于.NET Framework 4.6+而不是.NET Core的依赖项。
Is there a way to convert my project to a full .NET Framework project? 有没有一种方法可以将我的项目转换为完整的.NET Framework项目?
Here's what I've tried: 这是我尝试过的:
I went to the project properties and attempted to change the project framework, but I don't see the option I need in the dropdown: 我去了项目属性并尝试更改项目框架,但是在下拉列表中没有看到我需要的选项:
If I click "Install other frameworks..." I'm taken to a page that says .NET Framework versions are included in Visual Studio 2017 -- which is exactly what I'm using to edit this project. 如果单击“安装其他框架...”,则会进入一个页面 ,显示.NET Framework版本包含在Visual Studio 2017中-这正是我用来编辑此项目的内容。 This is where I got stuck. 这就是我卡住的地方。
If you're happy with it still using the new tooling, the easiest approach is probably just to edit the project file (csproj). 如果您仍然对使用新工具感到满意,最简单的方法可能就是编辑项目文件(csproj)。 Right-click on the project in Solution Explorer and you should have a context menu option of "Edit <yourproject>.csproj". 右键单击解决方案资源管理器中的项目,您应该具有上下文菜单选项“编辑<您的项目> .csproj”。 Click on that, and just change 单击它,然后更改
<TargetFramework>netcoreapp1.1</TargetFramework>
to 至
<TargetFramework>net46</TargetFramework>
... and I suspect you'll be good to go. ...而且我怀疑你会很好。 (It may confuse VS for a little while as it restores appropriate packages etc.) (在恢复适当的软件包等时,它可能会使VS迷惑一阵子。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.