Visual Studio 2017 参考与依赖关系 [英] Visual Studio 2017 References vs Dependencies

查看:44
本文介绍了Visual Studio 2017 参考与依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 2017 中有一个基于 .NET 4.7 框架构建的 .NET Core 解决方案.

I have a .NET Core solution in visual studio 2017 that is building against the .NET 4.7 framework.

在主 Web 应用程序中有一个依赖项菜单,可将引用分解为逻辑类别(分析器、程序集、NuGet、项目).

In the main web application there is a dependencies menu that breaks down references into logical categories (Analyzers, Assemblies, NuGet, Projects).

在辅助项目中,它只有一个参考菜单,里面的所有东西都乱七八糟.有没有办法在这里获得与 Web 应用程序相同的处理方式?

In the helper project it only has a references menu with everything jumbled inside. Is there a way to get the same treatment here as the web application got?

推荐答案

根据项目文件类型而定.较旧的 Full Framework 项目文件为您提供 References 区域,而较新的项目文件为您提供 Dependencies 区域.换句话说,只要是 .NET Framework 4.7 项目,您就无能为力.

It's based on the project file type. The older Full Framework project file gives you the References area, whereas the newer project files give you the Dependencies area. In other words, as long as it's a .NET Framework 4.7 project, there's nothing you can do about it.

也就是说,您可以简单地将其设为 .NET Standard 2.0 项目,这确实受益于新样式的项目文件.实际上,无论如何,您的所有类库都应该以 .NET Standard 为目标,以获得更好的互操作性.

That said, you can simply make it a .NET Standard 2.0 project, which does benefit from the new-style project file. Really, all your class libraries should be targeting .NET Standard, anyways, for greater interoperability.

这篇关于Visual Studio 2017 参考与依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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