diff --git a/SHADE_Engine/src/Scripting/SHScriptEngine.cpp b/SHADE_Engine/src/Scripting/SHScriptEngine.cpp
index 1fa4e6d7..9d3ad3e8 100644
--- a/SHADE_Engine/src/Scripting/SHScriptEngine.cpp
+++ b/SHADE_Engine/src/Scripting/SHScriptEngine.cpp
@@ -238,8 +238,13 @@ namespace SHADE
void SHScriptEngine::GenerateScriptsCsProjFile(const std::filesystem::path& path) const
{
+ // Compute relative path
+ const std::filesystem::path EXE_DIR = std::filesystem::current_path();
+ const std::filesystem::path MANAGED_DLL_DIR = EXE_DIR / "SHADE_Managed.dll";
+ const std::filesystem::path CS_DLL_DIR = EXE_DIR / "SHADE_CSharp.dll";
+
// Sample
- static std::string_view FILE_CONTENTS =
+ static std::string_view FILE_CONTENTS_BEGIN =
"\n\
\n\
net5.0\n\
@@ -269,14 +274,12 @@ namespace SHADE
\n\
\n\
\n\
- \n\
- ..\\..\\bin\\Debug\\SHADE_Managed.dll\n\
- ..\\..\\bin\\Release\\SHADE_Managed.dll\n\
- \n\
- \n\
- ..\\..\\bin\\Debug\\SHADE_CSharp.dll\n\
- ..\\..\\bin\\Release\\SHADE_CSharp.dll\n\
- \n\
+ \n";
+ static std::string_view FILE_CONTENTS_MID =
+" \n\
+ \n";
+ static std::string_view FILE_CONTENTS_END =
+" \n\
\n\
";
@@ -286,7 +289,12 @@ namespace SHADE
throw std::runtime_error("Unable to create CsProj file!");
// Fill the file
- file << FILE_CONTENTS;
+ const std::filesystem::path CSPROJ_DIR = path.parent_path();
+ file << FILE_CONTENTS_BEGIN
+ << " " << std::filesystem::relative(MANAGED_DLL_DIR, CSPROJ_DIR).string() << "\n"
+ << FILE_CONTENTS_MID
+ << " " << std::filesystem::relative(CS_DLL_DIR, CSPROJ_DIR).string() << "\n"
+ << FILE_CONTENTS_END;
// Close
file.close();