如何将 xproj(asp.net/dotnet 核心项目)与 shproj(共享项目)一起使用? [英] How can I use xproj (asp.net/dotnet core project) with shproj (shared project)?

查看:25
本文介绍了如何将 xproj(asp.net/dotnet 核心项目)与 shproj(共享项目)一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从 .Net 核心项目 (.xproj) 引用共享项目 (.shrpoj)?

Is it possible to reference a Shared project (.shrpoj) from a .Net core project (.xproj)?

我看不到路,但我可能会遗漏一些东西.

I can't see a way, but I could be missing something.

如果以下链接停止工作:

In case the link below stops working:

.net core world 中 shproj 的替代方法是在 project.json 文件的 buildOptions 部分添加一个 compile 部分.

The alternative to shproj in .net core world is to add a compile section to the buildOptions section of the project.json file.

例如:

"buildOptions": {
 "compile": {
   "include": [
     "../../shared/**/*.cs"
   ]
 }
}

推荐答案

不支持.对不起.您可以通过在 project.json

It's not supported. Sorry. You can share the code though by including the code files in project.json

以下是在项目中包含额外源文件的方法:https://github.com/aspnet/MusicStore/blob/c83fbdbf127b95d8505b6a55010eb129f23e6530/src/MusicStore/project.json#L7-L12

Here's how you include extra source files in a project: https://github.com/aspnet/MusicStore/blob/c83fbdbf127b95d8505b6a55010eb129f23e6530/src/MusicStore/project.json#L7-L12

这篇关于如何将 xproj(asp.net/dotnet 核心项目)与 shproj(共享项目)一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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