Can't compile from editor (but works in visual studio)


When i try to compile my project from the xenko editor i have this error, but when i build from visual studio, it works perfectly, what could be the problem ? i have checked in notepad++ the sln file and it looks like it’s not corrupted, and the project loads perfectly in xenko, it’s only at compilation that it doesn’t work

C:\Users\Admin\Documents\Xenko Projects\Dream_of_Moonlight\dream-of-moonlight-official-source-code\DreamOfMoonlight\DreamOfMoonlight.sln(2,1): Error: The project file could not be loaded. Données non valides au niveau racine. Ligne 2, position 1.


Could you display the first two lines of the file (since it seems to be where the parsing fails). Also check the encoding of the file, sometimes UTF-8 with BOM mess things up.


this is the sln file, i use visual studio 2017


Try removing the empty line. There shouldn’t be any. And be sure the encoding is UTF-8 without BOM.


I have multiple times tried to change the encoding and multiple times tried to remove the empty line, it doesn’t change anything


Did you edit your file manually? You have twice the mention of the Game project (DreamOfMoonlight.Game) with a different GUID. See lines 13 and 14. This means your file is corrupted somehow.

Visual Studio seems to be more permissive but MSBuild from the command line (used by the Game Studio) is not.

Note: it could also have happen if you work in a team, use a file version system and had a conflict that was not resolved properly.


i haven’t edited my file manually, but maybe it got a bit corrupted, what could i do in order to fix it ?
I tried to remove the second reference to DreamOfMoonlight.Game but when i do that the gamestudio won’t load the solution at all


This is a bug, i found how to reproduce the bug

i’ve been able to reproduce it

the way to reproduce this bug is to drag and drop a folder containing scripts to the project in visual studio, once it’s saved, i’ve checked, this is not visual studio that corrupted the sln itself, but once xenko reloaded the project with this modification, it recreated the double project bug

i’ve been forced to drag and drop the folder in visual studio, since when i drag and drop cs scripts or folders containing cs scripts in xenko, it imports them as raw assets

this problem happens too when i add a reference to a dll from visual studio


Why would you drag and drop scripts in Xenko? It is not the way to create scripts. You should either create them in the Game Studio or add a class in Visual Studio. Note that since Visual Studio always works with an in-memory project you have to “Save All” after adding a class in order to the Game Studio to detect the changes.


i’ve tried anyway to use the normal way, it finished by randomly recreating the bug even without draging anything new
the engine seems to be too unstable in its current state, i’ll maybe retry to use it later when it will be in a more stable state, but currently, i think i’ll make my game on Unity or Unreal to avoid having too much problems like this


I never heard any issue like the one you have right now. There are a number of projects using Xenko right now and none reported such issue.

You are obviously doing something that we didn’t think of. Could you maybe give us more details on all the steps that lead to this?


I’ve my entire project on bitbucket, i could give you access to the project