如何在OS X和vs代码上使用多个.net项目 [英] How to work with multiple .net projects on os x and vs code

查看:84
本文介绍了如何在OS X和vs代码上使用多个.net项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用vs代码创建典型的解决方案/项目布局.我使用yo aspnet创建了各种库,但是我不知道如何在vs代码中引用项目.我是否在根目录使用单个project.json?它如何知道启动项目和入口点是什么?另外,是否有办法在命名空间上获得智能?

I am trying to create a typical solution/project layout using vs code. I created the various libraries using yo aspnet, but I don't know how to reference projects in vs code. Do I use a single project.json at the root? How does it know what the startup project and entry point are? Also, is there a way to get intellisense on the namespacing?

推荐答案

如果您不使用Visual Studio(完整版),则不需要解决方案或xproj文件.您只需要使用文件夹和project.json文件来标记您的项目,然后每个项目都可以在项目文件的dependencies部分中添加对另一个项目的引用,如本例所示:

If you don't use Visual Studio (the full version), then you don't need a solution or xproj files. You just use folders and project.json files to mark your projects then each project can add a reference to another one in the dependencies section of the project file, like in this example:

https: //github.com/aspnet/Configuration/blob/1b302daf1c9bf7e723a26f5507f033c3e313e106/src/Microsoft.Extensions.Configuration.Ini/project.json#L20-L23

编辑(评论摘要):

  • 要引用其他文件夹中的项目,请将其添加到global.json文件
  • 要在VS代码中获得智能,您必须选择一个项目(窗口右下角有一个下拉菜单)

这篇关于如何在OS X和vs代码上使用多个.net项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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