# Minimal P/Invoke + net5.0 example ?

**URL:** https://discourse.cmake.org/t/minimal-p-invoke-net5-0-example/7937
**Category:** Code
**Tags:** os:windows
**Created:** [April 20, 2023, 6:30am UTC](https://discourse.cmake.org/t/minimal-p-invoke-net5-0-example/7937 "2023-04-20T06:30:19Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![mattsnowboard](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mattsnowboard/32/2457_2.png) [@mattsnowboard](https://discourse.cmake.org/u/mattsnowboard)
#### Post date: [April 20, 2023, 10:05pm UTC](https://discourse.cmake.org/t/minimal-p-invoke-net5-0-example/7937/2 "2023-04-20T22:05:51Z")

</div>

`DOTNET_TARGET_FRAMEWORK_VERSION` should be `DOTNET_TARGET_FRAMEWORK`.

Note that the “SDK style” .NET projects will be Any CPU and there is no way to change it to match the architecture of your native code. [C# SDK style projects Any CPU - Code - CMake Discourse](https://discourse.cmake.org/t/c-sdk-style-projects-any-cpu/5913)

---

_[View the full topic](https://discourse.cmake.org/t/minimal-p-invoke-net5-0-example/7937)._
