VS/CSharp: unable to add app.manifest to dotnet core project
Trying to add the following manifest file to a dotnet cmake project does not result in the application manifest being used during compilation.
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
</assembly>
cmake_minimum_required(VERSION 3.25.1)
project(myapp LANGUAGES CSharp)
# https://stackoverflow.com/questions/2074144/generate-c-sharp-project-using-cmake
include(CSharpUtilities)
set(CMAKE_CSharp_FLAGS "/platform:anycpu")
file(GLOB SOURCES *.cs *.manifest)
add_executable( myapp ${SOURCES})
set(CMAKE_VS_NUGET_PACKAGE_RESTORE true)
set_target_properties(myapp PROPERTIES
DOTNET_SDK "Microsoft.NET.Sdk"
DOTNET_TARGET_FRAMEWORK "net6.0"
VS_GLOBAL_Configurations "Debug;Release;RelWithDebInfo;MinSizeRel"
VS_GLOBAL_Version "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}.${VERSION_BUILD}" FILE_CONTENTS "${FILE_CONTENTS}"
VS_GLOBAL_ImplicitUsings enable)
set_property(TARGET myapp PROPERTY VS_PACKAGE_REFERENCES
"NUnit_3.13.3")
install( TARGETS myapp
COMPONENT default
DESTINATION . )
Edited by elksson