I have a dotnet SDK .sln
(and a build.proj
) with <TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
. It builds on Windows using Visual Studio and dotnet build
, but I'd also like it to build as many other places as possible. What do I need to put in my README.md and/or what can I put in the project files to make it build on Rider and/or on from bash on a Mac?
相关问题
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- Dotnet Core API - Get the URL of a controller meth
- Why am I unable to run dotnet tool install --globa
- Xcode debugger displays incorrect values for varia
In order to build via bash on a vanilla Mac, the minimal steps seem to be:
dotnet build SolutionFileName.sln
should now work(Currently) The simplest way to build for a .NET Framework TFM when running on either macOS or Linux using the .NET Core CLI, is to utilize the .NET Framework Targeting Pack Nuget Packages from Microsoft (currently in preview):
You may either include the Microsoft.NETFramework.ReferenceAssemblies metapackage; or use just the specific package, which is in your case Microsoft.NETFramework.ReferenceAssemblies.net461.
Add the package to the
*.csproj
or yourDirectory.Build.props
:Note: The
PrivateAssets
attribute controls which dependency assets will be consumed but won't flow to the parent project. See the docs.