premake / premake/premake-core
Error loading/configuring a C# .net project
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 3.6k
- Forks
- 654
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 13
Description
What seems to be the problem?
Hi everyone! First of all thanks in advance for your help.
I'm trying to set up my C# .net project with premake5 and I'm having the next error:
Current solution contains incorrect configurations mappings. It may causes projects to not work correctly. Open the Configuration Manager to fix them.

This happens right after generating the project files when I open the Visual Studio solution.
Which is quite weird is if I press the "Open Configuration Manager" button and close the pop up without changing anything. It works.
Apart from that, the bin and obj directories are not properly configurated. I got a bin/ and obj/ generated inside the project folder.
What did you expect to happen?
A C# .net project working fine. Also the bin and obj directories generated inside the project folder should be in the targetdir and objdir specificated locations
What have you tried so far?
I've tried to write my own Directory.Build.props in order to patch some errors but it doesn't work as expected and as I said it's just a patch. I would like premake5 to do this.
How can we reproduce this?
You can reproduce this by replicating my little test project. Having installed NET core 6.0 and visual studio tools needed to create a net core project.
This is my directory hierarchy:
- LeafEditor (folder with C# code and project)
- src (empty folder)
- premake5.lua (I will call it Project premake)
- premake5.lua (I will call it Workspace premake)
- premake5.exe
The code of Workspace premake looks like this:
workspace "LeafEngine"
startproject "LeafEditor"
configurations { "Debug", "Release" }
platforms { "x86", "x86_64" }
flags { "MultiProcessorCompile" }
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.platform}"
include "LeafEditor"
The code of Project premake looks like this:
project "LeafEditor"
kind "WindowedApp"
language "C#"
csversion "10"
clr "Unsafe"
targetdir ("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}")
objdir ("%{wks.location}/bin-obj/" .. outputdir .. "/%{prj.name}")
dotnetframework "net6.0"
files
{
"src/**.cs",
"src/**.xaml",
"src/**.xaml.cs",
}
links
{
"Microsoft.CodeAnalysis.CSharp.NetAnalyzers",
"Microsoft.CodeAnalysis.NetAnalyzers",
"System.Text.Json.SourceGeneration",
"Microsoft.NETCore.APP",
}
filter "system:Windows"
defines "LF_WINDOWS"
filter "system:Unix"
defines "LF_LINUX"
filter "configurations:Debug"
defines "LF_DEBUG"
runtime "Debug"
symbols "on"
filter "configurations:Release"
defines "LF_RELEASE"
runtime "Release"
optimize "full"
That is all you need to reproduce the bug.
What version of Premake are you using?
premake5 (Premake Build Script Generator) 5.0.0-beta1
I tried building for Visual Studio 2019 and 2022.
Anything else we should know?
As I said the project builds once I hit the "Open Configuration Manager" but the platform for this build is "Any CPU" and I can't change that.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the Workspace premake and Project premake scripts, using the stated Premake 5.0.0-beta1 and Visual Studio 2019 or 2022 setup. Inspect the generated solution and project configuration mappings and output paths; done means the warning is absent and bin/obj are placed in the configured targetdir and objdir.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, lua
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100