Ganesh_verma Ответов: 0

System.missingmethodexception: метод не найден 'microsoft.lync.model.lyncclient


Hi All,

I have created one application of Lync SDK using dlls

Microsoft.Lync.Controls.dll
Microsoft.Lync.Model.dll
Microsoft.Lync.Utilities.dll
Microsoft.Lync.Controls.Framework.dll
Microsoft.Lync.Controls.Design.dll

All these dlls are copied into bin folder, application is working fine but some machine have same dlls into gac folder my application is not working on that machine and getting error as below

System.MissingMethodException: Method not found: 'Microsoft.Lync.Model.LyncClient Microsoft.Lync.Model.LyncClient.GetClient()'.    at MitelPlugin.Helper.LyncHelper.get_LyncObj()    at MitelPlugin.App..ctor()

I have added following details into config file to enforce to use local assembly but issue is still not resolved 
Please let me know if any other approach (I don’t have option to remove dll from gac)?

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
	 <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">		
		<dependentAssembly>
			<assemblyIdentity name="Microsoft.Lync.Controls.dll" PublicKeyToken="71e9bce111e9429c" />
			<codebase version="15.0.0.0" href="~\Microsoft.Lync.Controls.dll" />
			<assemblyIdentity name="Microsoft.Lync.Controls.Framework.dll" PublicKeyToken="71e9bce111e9429c" />
			<codebase version="15.0.0.0" href="~\Microsoft.Lync.Controls.Framework.dll" />
			<assemblyIdentity name="Microsoft.Lync.Model.dll" PublicKeyToken="71e9bce111e9429c" />
			<codebase version="15.0.0.0" href="~\Microsoft.Lync.Model.dll" />
			<assemblyIdentity name="Microsoft.Lync.Utilities.dll" PublicKeyToken="71e9bce111e9429c" />
			<codebase version="15.0.0.0" href="~\Microsoft.Lync.Utilities.dll" />
			<assemblyIdentity name="Microsoft.Office.Uc.dll" PublicKeyToken="71e9bce111e9429c" />
			<codebase version="15.0.4454.1509" href="~\Microsoft.Office.Uc.dll" />
		</dependentAssembly>
      <probing privatePath="Skins"/>
    </assemblyBinding>
  </runtime>


Что я уже пробовал:

I have added following details into config file to enforce to use local assembly but issue is still not resolved 
Please let me know if any other approach (I don’t have option to remove dll from gac)?

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
	 <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">		
		<dependentAssembly>
			<assemblyIdentity name="Microsoft.Lync.Controls.dll" PublicKeyToken="71e9bce111e9429c" />
			<codebase version="15.0.0.0" href="~\Microsoft.Lync.Controls.dll" />
			<assemblyIdentity name="Microsoft.Lync.Controls.Framework.dll" PublicKeyToken="71e9bce111e9429c" />
			<codebase version="15.0.0.0" href="~\Microsoft.Lync.Controls.Framework.dll" />
			<assemblyIdentity name="Microsoft.Lync.Model.dll" PublicKeyToken="71e9bce111e9429c" />
			<codebase version="15.0.0.0" href="~\Microsoft.Lync.Model.dll" />
			<assemblyIdentity name="Microsoft.Lync.Utilities.dll" PublicKeyToken="71e9bce111e9429c" />
			<codebase version="15.0.0.0" href="~\Microsoft.Lync.Utilities.dll" />
			<assemblyIdentity name="Microsoft.Office.Uc.dll" PublicKeyToken="71e9bce111e9429c" />
			<codebase version="15.0.4454.1509" href="~\Microsoft.Office.Uc.dll" />
		</dependentAssembly>
      <probing privatePath="Skins"/>
    </assemblyBinding>
  </runtime>

Kornfeld Eliyahu Peter

GetClient () - это статический метод! Как вы это называете?

Ganesh_verma

Я создал экземпляр, как показано ниже

private static volatile LyncClient lyncObj;
        /// <summary>   The lock. 
 internal static readonly object _lock = new object();

public static LyncClient LyncObj
        {
            get
            {
                if (lyncObj == null)
                {
                    lock (_lock)
                    {
                        if (lyncObj == null)
                        {
                            while (!WaitForLyncStart())
                            {
                                Thread.Sleep(1000);
                            }
                            lyncObj = LyncClient.GetClient();
                        }
                    }
                }
                return lyncObj;
            }
        }

Ganesh_verma

это работает нормально, если та же dll недоступна в папке gac машины

0 Ответов