premake-core icon indicating copy to clipboard operation
premake-core copied to clipboard

C++/CLI Targeting Net6.0

Open Laocoon7 opened this issue 2 years ago • 1 comments

What seems to be the problem? An invalid string is written to the "targetframework" configuration when targeting net6.0 with a c++/cli project.

clr "on"
dotnetframework "net6.0"

This causes the project to not load in VisualStudio2022.

What did you expect to happen? Be able to load the project in VisualStudio and: Project "Configuration Properties->Advanced->C++/CLI Properties->.NET Core Target Framework" to be set to "net6.0"

What have you tried so far? This is probably related to issue #1865

How can we reproduce this?

workspace "Citadel"
    configurations { "Debug", "Release" }

    project "VKR"
    kind "SharedLib"
    language "C++"
    clr "NetCore"
    dotnetframework "net6.0"

What version of Premake are you using? premake5.0.0-beta1

Anything else we should know? The error message:

[Microsoft.Build.Utilities.ToolLocationHelper]::GetPathToStandardLibraries(_.vnet6.0, '', x64, '')' cannot be evaluated. Input string was not in a correct format. $RelativePath\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets

This seems like the commit to add net5.0+ https://github.com/premake/premake-core/commit/cada88b037bdcdba0cd5efdc82a440bc44f1e5b8

Laocoon7 avatar May 04 '22 10:05 Laocoon7

Late follow up, but could you confirm if this is an issue just affecting your VS2022 install versus older versions of Visual Studio? This appears to be an issue with how the CLR version is emitted in the project file.

nickclark2016 avatar Jun 25 '22 23:06 nickclark2016