Exception has been thrown by the target of an invocation

bmarzanobmarzano Posts: 5
Hello,

New to the forum here, and just purchased a few Red Gate tools. Looking for some help. I've installed SQL Source Control 3 on a Windows 7 machine with SQL Server 2005 SSMS. When starting SSMS, I get the error message: Exception has been thrown by the target of an invocation. As of yet, I've been unable to use the Source Control at all due to this error. Any help is greatly appreciated!

Thanks!

Brian

Comments

  • James BJames B Posts: 1,124 Silver 4
    Thanks for your post.

    It's hard to say the cause without seeing the full error - if you could send the details over to support@red-gate.com with F0060374 in the subject line we can see if there are some helpful details.

    Based on the initial message you gave though, the first thing I would suggest is (re)installing .NET 3.5 SP1 from here to see if it helps.
    Systems Software Engineer

    Redgate Software

  • I was unable to simply reinstall .NET 3.5.1 as I'm in Windows 7. I was able to verify the integrity of the installation using sfc /scannow though.

    The exception appears to have to do with SourceGear Vault/Fortress. I have previously had Vault installed, but it was uninstalled long before I installed SQL Source Control. I've reinstalled it and that didn't resolve the issue. I'm working with support now, ticket F0060382, but so far no luck. Thanks for any help anyone can provide out there!

    Looking in the log file, here's the full exception:
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> RedGate.Shared.Utils.IO.Serialization.SerializationInvalidTypeException: Non-existant Type VaultLocation
       at RedGate.Shared.Utils.IO.Serialization.XMLSerializeFormatter.#bco(String #hvPb, Boolean #IIrc)
       at RedGate.Shared.Utils.IO.Serialization.XMLSerializeFormatter.ReadObject(String name, Boolean isOptional)
       at RedGate.SQLSourceControl.Engine.LinkedDatabase.Deserialize(Int32 versionId, ISerializeFormatter formatter)
       at RedGate.Shared.Utils.IO.Serialization.XMLSerializeFormatter.#bco(String #hvPb, Boolean #IIrc)
       at RedGate.Shared.Utils.IO.Serialization.XMLSerializeFormatter.#IFeb[#NrPb](String #hvPb, Boolean #IIrc)
       at RedGate.Shared.Utils.IO.Serialization.XMLSerializeFormatter.ReadListInvalidVersionsOk[T](String name)
       at RedGate.SQLSourceControl.Engine.LinkedDatabaseStoreSerializable.Deserialize(Int32 versionId, ISerializeFormatter formatter)
       at RedGate.Shared.Utils.IO.Serialization.XMLSerializeFormatter.DeserializeRootObject(XmlReader #2FWb, String #hvPb, String #h8Pb)
       at RedGate.Shared.Utils.IO.Serialization.XMLSerializeFormatter.DeserializeRootObject(String fileName, String name, String typeName)
       at RedGate.SQLSourceControl.Engine.PersistenceFactory.#VAq.#ngsb()
       at RedGate.SQLSourceControl.Engine.PersistenceFactory.#Jf9(String , Action )
       at RedGate.SQLSourceControl.Engine.PersistenceFactory.GenericFactory[T](String xmlFile, String type)
       at RedGate.SQLSourceControl.Engine.PersistenceManager.#uFvb()
       at RedGate.SQLSourceControl.Engine.AutoReloadingPersistentStore`1..ctor(String , Func`1 )
       at RedGate.SQLSourceControl.Engine.LinkedDatabaseStore..ctor(String fileName, Func`1 createStore, Action`1 persistStore)
       at RedGate.SQLSourceControl.Engine.PersistenceManager.#5Jc()
       at Ninject.Core.Creation.Providers.FactoryMethodProvider`1.CreateInstance(IContext context)
       at Ninject.Core.Creation.SimpleProvider`1.Create(IContext context)
       at Ninject.Core.Activation.ActivatorBase.Create(IContext context, Object& instance)
       at Ninject.Core.Behavior.BehaviorBase.CreateInstance(IContext context, Object& instance)
       at Ninject.Core.Behavior.SingletonBehavior.Resolve(IContext context)
       at Ninject.Core.KernelBase.ResolveInstance(Type service, IContext context, Boolean isEagerActivation)
       at Ninject.Core.KernelBase.Get[T](IParameterCollection parameters)
       at #mKi.#pKi.Get[#NrPb](Object[] )
       at RedGate.SQLSourceControl.Engine.ObjectFactoryShared.#Gxf.#jii()
       at RedGate.SQLSourceControl.Engine.ObjectFactoryShared.#21e[#NrPb](Func`1 )
       at RedGate.SQLSourceControl.Engine.ObjectFactoryShared.Get[T](Object[] ctorArgs)
       at RedGate.SQLSourceControl.Engine.ObjectFactoryShared.#bDj[#NrPb]()
       at Ninject.Core.Creation.Providers.FactoryMethodProvider`1.CreateInstance(IContext context)
       at Ninject.Core.Creation.SimpleProvider`1.Create(IContext context)
       at Ninject.Core.Activation.ActivatorBase.Create(IContext context, Object& instance)
       at Ninject.Core.Behavior.BehaviorBase.CreateInstance(IContext context, Object& instance)
       at Ninject.Core.Behavior.TransientBehavior.Resolve(IContext context)
       at Ninject.Core.KernelBase.ResolveInstance(Type service, IContext context, Boolean isEagerActivation)
       at Ninject.Core.KernelBase.Get(Type type, IContext context)
       at Ninject.Core.Resolution.Resolvers.StandardResolver.ResolveInstance(IContext outerContext, IContext innerContext)
       at Ninject.Core.Resolution.Resolvers.ResolverBase.Resolve(IContext outerContext, IContext innerContext)
       at Ninject.Core.Creation.Providers.InjectionProviderBase.ResolveConstructorArguments(IContext context, ConstructorInjectionDirective directive)
       at #mKi.#oKi.#VjE(IContext , ConstructorInjectionDirective )
       at Ninject.Core.Creation.Providers.InjectionProviderBase.CallInjectionConstructor(IContext context)
       at Ninject.Core.Creation.Providers.InjectionProviderBase.Create(IContext context)
       at Ninject.Core.Activation.ActivatorBase.Create(IContext context, Object& instance)
       at Ninject.Core.Behavior.BehaviorBase.CreateInstance(IContext context, Object& instance)
       at Ninject.Core.Behavior.SingletonBehavior.Resolve(IContext context)
       at Ninject.Core.KernelBase.ResolveInstance(Type service, IContext context, Boolean isEagerActivation)
       at Ninject.Core.KernelBase.Get(Type type, IContext context)
       at Ninject.Core.Resolution.Resolvers.StandardResolver.ResolveInstance(IContext outerContext, IContext innerContext)
       at Ninject.Core.Resolution.Resolvers.ResolverBase.Resolve(IContext outerContext, IContext innerContext)
       at Ninject.Core.Creation.Providers.InjectionProviderBase.ResolveConstructorArguments(IContext context, ConstructorInjectionDirective directive)
       at #mKi.#oKi.#VjE(IContext , ConstructorInjectionDirective )
       at Ninject.Core.Creation.Providers.InjectionProviderBase.CallInjectionConstructor(IContext context)
       at Ninject.Core.Creation.Providers.InjectionProviderBase.Create(IContext context)
       at Ninject.Core.Activation.ActivatorBase.Create(IContext context, Object& instance)
       at Ninject.Core.Behavior.BehaviorBase.CreateInstance(IContext context, Object& instance)
       at Ninject.Core.Behavior.SingletonBehavior.Resolve(IContext context)
       at Ninject.Core.KernelBase.ResolveInstance(Type service, IContext context, Boolean isEagerActivation)
       at Ninject.Core.KernelBase.Get[T](IParameterCollection parameters)
       at #mKi.#pKi.Get[#NrPb](Object[] )
       at RedGate.SQLSourceControl.Engine.ObjectFactoryShared.#Gxf.#jii()
       at RedGate.SQLSourceControl.Engine.ObjectFactoryShared.#21e[#NrPb](Func`1 )
       at RedGate.SQLSourceControl.Engine.ObjectFactoryShared.Get[T](Object[] ctorArgs)
       at RedGate.SQLSourceControl.Engine.ObjectFactoryShared.#bDj[#NrPb]()
       at Ninject.Core.Creation.Providers.FactoryMethodProvider`1.CreateInstance(IContext context)
       at Ninject.Core.Creation.SimpleProvider`1.Create(IContext context)
       at Ninject.Core.Activation.ActivatorBase.Create(IContext context, Object& instance)
       at Ninject.Core.Behavior.BehaviorBase.CreateInstance(IContext context, Object& instance)
       at Ninject.Core.Behavior.TransientBehavior.Resolve(IContext context)
       at Ninject.Core.KernelBase.ResolveInstance(Type service, IContext context, Boolean isEagerActivation)
       at Ninject.Core.KernelBase.Get(Type type, IContext context)
       at Ninject.Core.Resolution.Resolvers.StandardResolver.ResolveInstance(IContext outerContext, IContext innerContext)
       at Ninject.Core.Resolution.Resolvers.ResolverBase.Resolve(IContext outerContext, IContext innerContext)
       at Ninject.Core.Creation.Providers.InjectionProviderBase.ResolveConstructorArguments(IContext context, ConstructorInjectionDirective directive)
       at Ninject.Core.Creation.Providers.InjectionProviderBase.CallInjectionConstructor(IContext context)
       at Ninject.Core.Creation.Providers.InjectionProviderBase.Create(IContext context)
       at Ninject.Core.Activation.ActivatorBase.Create(IContext context, Object& instance)
       at Ninject.Core.Behavior.BehaviorBase.CreateInstance(IContext context, Object& instance)
       at Ninject.Core.Behavior.SingletonBehavior.Resolve(IContext context)
       at Ninject.Core.KernelBase.ResolveInstance(Type service, IContext context, Boolean isEagerActivation)
       at Ninject.Core.KernelBase.Get[T]()
       at RedGate.SQLSourceControl.CommonUI.ObjectFactory.Get[T]()
       at RedGate.SQLSourceControl.CommonUI.ConnectBase..ctor(StandardModule versionSpecificModule, StandardModule sharedModule)
       at RedGate.SQLSourceControl.CommonUI.Shared.ConnectShared..ctor(StandardModule versionSpecificModule)
       at RedGate.SQLSourceControl.SSMS2005.Connect..ctor()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType)
       at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)
       at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at RedGate.SQLSourceControl.Engine.ReflectionUtils.Create[TInstance](Type type)
       at RedGate.SQLSourceControl.Engine.NinjectExtensions.BestTypeFinder.TryGetBestCompatible[T](String[] assemblies, TypeFilter typefilter, T& instance)
       at RedGate.SQLSourceControl.Engine.NinjectExtensions.BestTypeFinder.TryGetBestCompatible[T](String[] assemblies, T& instance)
       at RedGate.SQLSourceControl.MasterComAddIn.Connect.#Tfc()
       at RedGate.SQLSourceControl.CommonUI.Forms.ErrorDialog.#Jfb1.#dCf()
       at RedGate.SQLSourceControl.Engine.SmartAssembly.ExceptionReporting.ErrorReporterBase.Do(Action , Predicate`1 , Boolean )
    
  • James BJames B Posts: 1,124 Silver 4
    If you're not *actually* using Vault, then it looks like there may be something left in one of the config files that makes it think it is.

    If you go to c:\users\<your username>\appdata\local\red gate\sql source control 3\, you should see a "LinkedDatabases.xml" and maybe a "TableDataConfigs.xml" file.

    Can you close down SSMS, then move both of those files elsewhere (such as on to your desktop). Can you then start up SSMS again, and try linking your database back to whichever source control system you're using?

    Does that seem to fix it?
    Systems Software Engineer

    Redgate Software

  • The data in that file does indeed point to the Vault server that we used to have. I deleted the file, and restarted, at which point it just created the exact same file with the same location and the same error. I feel like we're heading in the right direction though!
  • James BJames B Posts: 1,124 Silver 4
    That file stores which database are linked, and to where- if you delete it, then restarting SSMS should in theory have not shown any databases as being linked.
    Can you check if you also have a SQL Source Control 2 (or 1!) folder with the same file? Perhaps it's spotting an old file and importing the settings across for v3...
    If so, delete the old files, then repeat the process you just did.
    Systems Software Engineer

    Redgate Software

  • That's what it is! That fixed it! Thank you so much!
  • James BJames B Posts: 1,124 Silver 4
    Glad to hear it's working now!
    Systems Software Engineer

    Redgate Software

  • lukastolukasto Posts: 2 New member
    I am having the same problem when connecting a database to Git.
    I've already reinstalled SQL Source Control and that didn't fix the problem.
    Deleting the above-mentioned files didn't help either, before that this database worked fine with Source Control but suddenly something broke.
    I was unable to get the current code from Git and I found information on some forum to disconnect the Git base and reconnect it. Disconnection was successful, but not connected anymore.
Sign In or Register to comment.