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:
The alternative to shproj in .net core world is to add a compile
section to the buildOptions
section of the project.json
file.
For example:
"buildOptions": {
"compile": {
"include": [
"../../shared/**/*.cs"
]
}
}
One method of adding references to your library is by typing it directly in the project. json file. As you can see that we have added some references under the dependencies section as shown in the following code. Let us now save this file and you will see that references are added to your library now.
Shared Projects let you write common code that is referenced by a number of different application projects. The code is compiled as part of each referencing project and can include compiler directives to help incorporate platform-specific functionality into the shared code base.
NET Core vs ASP.NET Core. . NET Core is a runtime to execute applications build on it. ASP.NET Core is a web framework to build web apps, IoT apps, and mobile backends on the top of .
It's not supported. Sorry. You can share the code though by including the code files in project.json
Here's how you include extra source files in a project: https://github.com/aspnet/MusicStore/blob/c83fbdbf127b95d8505b6a55010eb129f23e6530/src/MusicStore/project.json#L7-L12
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With