Closed ddobrev closed 1 year ago
In the C# net core support, I added dotnetbase.isNewFormatProject(cfg) to check whether we're targeting framework or net core. So maybe someone needs replace https://github.com/premake/premake-core/blob/c6580ff1cefa7660a0df59f3da90dff0bf1be417/modules/vstudio/vs2010_vcxproj.lua#L118 with the below
if framework and dotnetbase.isNewFormatProject(prj) then
p.w('<TargetFrameworkVersion>%s</TargetFrameworkVersion>', framework)
else
p.w('<TargetFrameworkVersion>v%s</TargetFrameworkVersion>', framework)
end
I'd do it, but I don't have a working machine at the moment...
Hi, I'm running into a similar issue now with the following being outputted and causing loading issues:
<TargetFrameworkVersion>vnet5.0</TargetFrameworkVersion>
Instead of how it should be:
<TargetFramework>net5.0</TargetFramework>
This is generated from the following premake script:
project "SHADE_Managed"
kind "SharedLib"
language "C++"
clr "NetCore"
dotnetframework "net5.0"
cppdialect "C++17"
@ClxS I have attempted a fix for this based on your suggestion and the expected fix for .NET 5.0. However, dotnetbase.isNewFormatProject(cfg)
does not seem to be present. I'm not very familiar with Lua, would it be possible for you to share how I might go about adding that in?
@Pycorax Is this using premake.override
, or are you modifying the Premake code to submit a fix for this?
@samsinsane I'm currently modifying the source code in the modules/vstudio/vs2010_vcxproj.lua
file. I can verify that without the conditional check, it fixes this issue but ends up breaking existing test cases for non-.NET 5.0+ projects.
You'll need to add local dotnetbase = p.vstudio.dotnetbase
near the top of vs2010_vcxproj.lua
.
What seems to be the problem? Creating a C++/CLI project targeting .NET Core with premake produces
<TargetFramework>vnetcoreapp3.1</TargetFramework>
in the project file.What did you expect to happen? premake produces
<TargetFramework>netcoreapp3.1</TargetFramework>
in the project file.What have you tried so far?
How can we reproduce this? Any premake project for C++/CLI targeting .NET Core.
What version of Premake are you using? Latest master at the time of writing.
Anything else we should know? The problem, as evident by the successful workaround, is in your function of
premake.vstudio.vc2010.targetFramework
. It has a hard-coded v.