views:

141

answers:

0

Hi, I've created a vsto 3.0 outlook 2007 plugin with visual studio 2008 (so I guess that I dont need to make a com shim because of the new security system). The assembly is signed and it gets installed and loaded. It works well for a few days but, suddenly, stops loading and I get this exception on the event viewer thrown by VSTOR3.0:

VSTOR3.0

Exception: Customization could not be loaded because the application domain could not be created.

************** Exception Text **************
Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: Customization could not be loaded because the application domain could not be created. ---> System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)
in System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
in System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
in System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
in System.Activator.CreateInstance(Type type, Boolean nonPublic)
in System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
in System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
in System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
in System.Activator.CreateInstance(String assemblyName, String typeName)
in System.AppDomain.CreateInstance(String assemblyName, String typeName)
in System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName)
in System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName)
in Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String documentFullLocation, String documentName, String assemblyLocation, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor)

I can get the plugin loaded only by uninstalling the plugin, vsto 3.0 sp1, vsto 3.0, rebooting the machine and then reinstall all of them! I cant do this always!!

I really dont know what to do, maybe I have some domain policy groups problem?? Or I must create a Com Shim?? I guess that the last one wasnt needed with the new vsto!!! Please someone help me :(