Using Visual Studio 2005 SDK 3.0 (August 2006 CTP), the latest VS SDK with VSTA.
I am stuck at a situation that the proxy threw an exception (listed below) when the Add-in tried to access the property of the Application class if the data type (a class) of that property is defined in a dependent component of the Application class.
The dependent component that contains the class definition of the Application property is a strong named and sitting in the GAC.
I found that it worked fine if the class definition is moved from the dependent component to the same project as the Application. But in our product we have to keep quite a few of the Application class member types in other components.
Any help is greatly appreciated.
[6904] Microsoft.VisualStudio.Tools.Applications.Samples.ShapeApp.AIMExtension.LoadAddIns:
[6904] Microsoft.VisualStudio.Tools.Applications.Contract.AddInException: System.Collections.Generic.KeyNotFoundException, mscorlib
[6904]
[6904] System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
[6904]
[6904] Server stack trace:
[6904] at System.ThrowHelper.ThrowKeyNotFoundException()
[6904] at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
[6904] at Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager.GetCanonicalName(TypeDescription localType)
[6904] at Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager.GetCanonicalName(Type localType)
[6904] at Microsoft.VisualStudio.Tools.Applications.RemoteTypeAdapter.System.AddIn.Contract.Automation.IRemoteTypeContract.GetCanonicalName()
[6904] at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[6904] at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[6904] at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[6904]
[6904] Exception rethrown at [0]:
[6904] at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
[6904] at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
[6904] at System.AddIn.Contract.Automation.IRemoteTypeContract.GetCanonicalName()
[6904] at Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager.LocalTypeFromRemoteType(IRemoteTypeContract typeToFind)
[6904] at Microsoft.VisualStudio.Tools.Applications.RemoteTypeAdapter.System.AddIn.Contract.Automation.IRemoteTypeContract.GetProperty(String name, BindingFlags bindingFlags, IRemoteTypeContract remoteReturnType, IArrayContract`1 remoteTypes)
[6904] at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[6904] at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[6904] at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[6904]
[6904] Exception rethrown at [1]:
[6904] at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
[6904] at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
[6904] at System.AddIn.Contract.Automation.IRemoteTypeContract.GetProperty(String name, BindingFlags bindingFlags, IRemoteTypeContract remoteReturnType, IArrayContract`1 remoteTypes)
[6904] at Microsoft.VisualStudio.Tools.Applications.RemoteType.GetPropertyImpl(String name, BindingFlags bindingFlags, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
[6904] at System.Type.GetProperty(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
[6904] at AgileSoftware.GUIHost.Application.get_MyTestProperty()
[6904] at CCEDesktopBasicAddInTest.ThisApplication.ThisApplication_Startup(Object sender, EventArgs e)
[6904] at CCEDesktopBasicAddInTest.ThisApplication.FinishInitialization()
[6904] at AgileSoftware.GUIHost.Application.Microsoft.VisualStudio.Tools.Applications.Contract.IEntryPointContract.FinishInitialization()
[6904] at Microsoft.VisualStudio.Tools.Applications.EntryPointAdapter.Microsoft.VisualStudio.Tools.Applications.Contract.IEntryPointContract.FinishInitialization()
[6904]
[6904] Server stack trace:
[6904] at Microsoft.VisualStudio.Tools.Applications.EntryPointAdapter.Microsoft.VisualStudio.Tools.Applications.Contract.IEntryPointContract.FinishInitialization()
[6904] at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md
[6904] , Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[6904] at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[6904] at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[6904]
[6904] Exception rethrown at [0]:
[6904] at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
[6904] at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
[6904] at Microsoft.VisualStudio.Tools.Applications.Contract.IEntryPointContract.FinishInitialization()
[6904] at Microsoft.VisualStudio.Tools.Applications.Internal.ExceptionFilter.ExceptionFilterHelper.CallFinishInitialization(IEntryPointContract hi, IExceptionFilterCallback callback)
[6904] at Microsoft.VisualStudio.Tools.Applications.AddInImpl.ExecutePhase(String methodName, IEntryPointContract targetEntryPoint)
[6904] at Microsoft.VisualStudio.Tools.Applications.AddInImpl.AttemptInternalLoad(IAppDomainBindingContract appDomainBinding, String appBase, String configFile, PermissionSet topOfStackPermission, StrongName[] strongNameAssemblies)
[6904] at Microsoft.VisualStudio.Tools.Applications.AddInImpl.InternalLoad(IAppDomainBindingContract appDomainBinding, String appBase, String configFile, PermissionSet topOfStackPermission, StrongName[] strongNameAssemblies)
[6904] at Microsoft.VisualStudio.Tools.Applications.AddInImpl.Load(String appBasePath)
[6904] at Microsoft.VisualStudio.Tools.Applications.AddIn.Load(String appBasePath)
[6904] at ASGUIHostVSTA.AIMExtension.LoadAddIns() in C:\Working\Plugin Framework\Source\AS GUI Host\ASGUIHostVSTA\ASGUIHostVSTA\Extenstion.cs:line 77
Roger