https://metaplay.io logo
Moving SharedCode directory
# questions-and-feedback
l
Hi all, I've recently initialized a new Metaplay Project into an existing Unity project. I've started configuring the PlayerModel, added a few simple actions, and everything seems fine. I'm now in a place where I want to coerce the Metaplay code into something that fits in better with the existing project's fairly strict file structure, namespaces, etc... However, I've hit a bit of a roadblock. If I rename the
sharedCode
directory, and make the corresponding change to
sharedCodeDir
in
metaplay-project.yaml
, and
Backend/Directory.Build.props
I still get the following when I try to run `metaplay dev server`; presumably because the SharedCode has not rebuilt - the
.dll
is missing from the server's assemblies.
Copy code
... <Various Success messages>

  Server failed with 4 error(s) (0.1s)
    C:\Users\laure\wkspaces\BeatHunter\Unity\BeatHunter\Backend\Server\Player\PlayerActor.cs(3,12): error CS0234: The type or namespace name 'Logic' does not exist in the namespace 'Game' (are you missing an assembly reference?)
    C:\Users\laure\wkspaces\BeatHunter\Unity\BeatHunter\Backend\Server\Player\PlayerActor.cs(22,55): error CS0246: The type or namespace name 'PlayerModel' could not be found (are you missing a using directive or an assembly reference?)
    C:\Users\laure\wkspaces\BeatHunter\Unity\BeatHunter\Backend\Server\Player\PlayerActor.cs(22,69): error CS0246: The type or namespace name 'IPlayerModelServerListener' could not be found (are you missing a using directive or an assembly reference?)
    C:\Users\laure\wkspaces\BeatHunter\Unity\BeatHunter\Backend\Server\Player\PlayerActor.cs(49,51): error CS0246: The type or namespace name 'PlayerModel' could not be found (are you missing a using directive or an assembly reference?)

Build failed with 4 error(s) in 1.3s
Any ideas? I guess I don't fully understand how the
sharedCode
gets compiled into the Backend code, or the implications of moving the sharedCode directory (is this at all supported?)
j
Hmm, just tested this and my IDE starts working fine and recognizes the types once I change Directory.Build.props, and building the image also works after updating the metaplay-project.yaml file. Perhaps try double checking all values (no typos and the same casing), cleaning your build output, and rebuilding SharedCode?
l
Thanks Jurjen, I'll take another look and report back a little bit later.