Hello everyone !
I’m creating this post today because I’m wondering how to generate a netcoreapp3.1 project with CMake. I have seen some examples online (for net framework 4.7.2) mentionning this
I tried to change it to
but it did not work. The TargetFramework does not appear on my csproj file and when I compile, it complains that some packages I am using are not compatible with net40 and that they’re supporting net45, netcoreapp2.1, netcoreapp3.1 and netstandard2.0.
Also I used this link for reference but I haven’t been successful
Because the CMake file is pretty small, I’m giving the full file as a comment here
Could someone help me to figure out what I’d need ?
Thanks in advance !!
Here is the full CMake file (I have only one, it’s a very small project)
project(AutoMaxLairUI LANGUAGES CSharp)
# Include CMake utilities for CSharp, for WinForm and WPF application support.
# Define the executable, including any .cs files.
# Set the .NET Framework version for the executable.
# set_property(TARGET AutoMaxLairUI PROPERTY DOTNET_TARGET_FRAMEWORK_VERSION "v4.7.2")
# set_property(TARGET AutoMaxLairUI PROPERTY DOTNET_TARGET_FRAMEWORK "netcoreapp3.1")
# set(CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION "v4.7.2")
# Set the executable to be 32-bit.
set_property(TARGET AutoMaxLairUI PROPERTY WIN32_EXECUTABLE TRUE)
# Set the C# language version (defaults to 3.0).
# Set the source file properties for Windows Forms use.
# Add in the .NET reference libraries.
set_property(TARGET AutoMaxLairUI PROPERTY VS_DOTNET_REFERENCES
set_property(TARGET AutoMaxLairUI PROPERTY VS_PACKAGE_REFERENCES