ERROR Photon.Hive.Plugin.PluginManager - System.IO.FileNotFoundExceptio

How to fix below error, I followed this URL https://doc.photonengine.com/en-us/server/current/plugins/getting-started to create my 1st plugin.

2022-03-24 17:10:20,356 [21] ERROR Photon.Hive.Plugin.PluginManager - System.IO.FileNotFoundException : The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

Stack Trace:

  at MyFirstPlugin.MyPluginFactory.CreatePlugin(String pluginName)

  at Photon.Hive.Plugin.PluginFactoryBase.Create(IPluginHost gameHost, String pluginName, Dictionary`2 config, String& errorMsg)

  at Photon.Hive.Plugin.PluginManager.CreatePluginWithFactory(IPluginHost sink, String pluginName)

  at Photon.Hive.Plugin.PluginManager.GetGamePlugin(IPluginHost sink, String pluginName)


2022-03-24 17:10:20,356 [21] DEBUG Photon.Hive.Plugin.CreateGameCallInfo - Fail: System.IO.FileNotFoundException : The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

Stack Trace:

  at MyFirstPlugin.MyPluginFactory.CreatePlugin(String pluginName)

  at Photon.Hive.Plugin.PluginFactoryBase.Create(IPluginHost gameHost, String pluginName, Dictionary`2 config, String& errorMsg)

  at Photon.Hive.Plugin.PluginManager.CreatePluginWithFactory(IPluginHost sink, String pluginName)

  at Photon.Hive.Plugin.PluginManager.GetGamePlugin(IPluginHost sink, String pluginName)


Comments

  • hi @Hemanth

    usually this exception contains info about file that was not found. I can not see entire message to help you here.

    I assume that your plugin depends on some other assembly and it is high probable that that assembly was not copied to plugins folder

    best,

    ilya

  • Hemanth
    Hemanth
    edited March 2022

    @chvetsov Thanks for the response, I have fixed the assembly files, But In the next step I am getting another error. Could you please help me on this?

    code

    using Photon.Hive.Plugin;

    namespace MyFirstPlugin

    {

      public class MyFirstPlugin : PluginBase

      {

        public override string Name => "MyFirstPlugin";

        private IPluginLogger pluginLogger;

        public override bool SetupInstance(IPluginHost host, Dictionary<string, string> config, out string errorMsg)

        {

          /*this.pluginLogger.InfoFormat("*********");*/

          this.pluginLogger = host.CreateLogger(this.Name);

          return base.SetupInstance(host, config, out errorMsg);

        }

        public override void OnCreateGame(ICreateGameCallInfo info)

        {

          this.pluginLogger.InfoFormat("OnCreateGame - ********this is custom code ************ {0} by user {1}", info.Request.GameId, info.UserId);

          info.Continue(); // same as base.OnCreateGame(info);

        }

      }

    }


  • hi, @Hemanth

    I think you just did not update you plugin after commenting of this line:

       /*this.pluginLogger.InfoFormat("*********");*/
    

    please make sure that everything is updated and try again. Please make sure that you are using Debug configuration, to make stack available

    best,

    ilya

  • @chvetsov , Thanks, it's working.