Cached assemblies on photon

Hi!
I'm using photon v4.0.28.2962 and have some problems with assemblies being cached.
I built a plugin that references to an assembly and everything's fine: plugin gets created and assembly gets loaded.
Then, I made some changes to that assembly and rebuilt the plugin. As the result the plugin gets created but new assembly is not get loaded. It seems like first of all Photon searches for an assembly in cache - is that right? What can I do to make Photon load the assembly from the local folder?
PS. Sorry for my English )

Comments

  • hi, @Djebedia

    photon loads plugin and all related dlls from plugins folder. we do not do caching

    in order to update plugin correctly you have to put new version in to separate folder and then update plugin.config

    best,
    ilya
  • @chvetsov Ilya, thanks for reply

    But I don't get it
    Maybe I've explained it not well enough
    I have two versions of plugin, one references to some dll v1.0.0.1 and the other - to dll v1.0.02. Those dlls are in plugin folders. But if I try to create the first plugin which references to dll v1.0.0.1 the newer version of dll is loaded instead. And that dll v1.0.0.2 is stored in Photon\deploy\LoadBalancing\GameServer\bin\Cache\Game\assembly\dl3\xxx\yyy folder
    So I want to load older version of dll which lies in plugin folder - what should I do?

    And what should I update in plugin.config?
  • what is your plugins folder structure? how do you add new version?

    best,
    ilya
  • Photon\deploy\Plugins\ConcreteGamePlugin - this is the main folder with plugins and each plugin is within its own folder in that main folder
  • how do you configure your plugins?
    best,
    ilya
  • chvetsov wrote: »
    how do you configure your plugins?

    Do you mean plugin factory? It has link to that "main folder" and depending on plugin version in plugin request it loads plugin dll from the correct folder
    Or are you talking about something else?
  • I'm talking about plugin.config. what do you do ?
    It should look like this:
    you have next folders strucuture
    Plugins/YouPluginName/Version/bin/ and here Plugin and helper assemblies
    so, for first version you will have it:
    Plugins/YouPluginName/1.0/bin/
    in your plugin.config there is 'Version' field that should be set to 1.0

    Once you have new version. Let's say '2.0', first what you do is copying of plugin to folder
    Plugins/YouPluginName/2.0/bin/ and then you update 'Version' field in plugin.config.

    In this case everything should be loaded correctly.

    Ah there is one thing. You may break this algorithm if you are loading helper dll your self using Assembly.Load or Assembly.LoadFrom methods

    best,
    ilya
  • Hm, I don't get it )
    I don't have plugin.config file
    But I found out something: it looks like first of all photon tries to load all necessary dlls from \Photon\deploy\LoadBalancing\GameServer\bin. In case those required dlls were found photon caches them at \Photon\deploy\LoadBalancing\GameServer\bin\Cache\Game\assembly\dl3. And in case those dlls were not found it tries to load them from plugin folder and does NOT cache them.
    So the solution for me was to remove those dlls from GameServer folder.
  • Hi @Djebedia,

    Sorry plugin.config is for v5 only.
    My colleague Ilya is on vacation for this week and the next.

    If I have to guess, I think you could disable this (shadow copying) caching and hot reload thing via PhotonServer.config under Application nodes, in this case for GameServer:
    • RestartDelayMilliseconds
    • WatchFiles
    • ExcludeFiles
    • EnableShadowCopy
    • EnableAutoRestart
    • ForceAutoRestart

    Read more here or here.
Sign In or Register to comment.