— New online course!  Getting Started with Azure DevOps — Special launch price 50% off —

NUnit, RegAsm, and “Failed to generate type library”

by

I’m trying to use COM+ to manage database transactions in my unit tests.  All of a sudden, I start getting all these weird errors saying “Failed to generate type library.“  No clue what was going on.


I ran “regasm“ over the unit test assembly and all was healed. 


Weird, huh?


-Ben


 


Failed to generate type library ‘c:docume~1admini~1.worlocals~1tempnunit20shadowcopycache632563509305979151testsassemblydl213c01406a598666_3383c501Popstick.Reporting.UnitTests.tlb’ for ‘Popstick.Reporting.UnitTests, Version=1.0.2014.28061, Culture=neutral, PublicKeyToken=f45aaab9ee016be8’.


Server stack trace:
   at System.EnterpriseServices.RegistrationDriver.GenerateTypeLibrary(Assembly asm, String tlb, Report report)
   at System.EnterpriseServices.RegistrationDriver.InstallAssembly(RegistrationConfig regConfig, Object obSync)
   at System.EnterpriseServices.RegistrationHelperTx.InstallAssemblyFromConfig(RegistrationConfig& regConfig, Object sync)
   at System.Runtime.Remoting.Messaging.Message.Dispatch(Object target, Boolean fExecuteInContext)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)


Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at System.EnterpriseServices.RegistrationHelperTx.InstallAssemblyFromConfig(RegistrationConfig& regConfig, Object sync)
   at System.EnterpriseServices.RegistrationHelper.TryTransactedInstall(RegistrationConfig regConfig)
   at System.EnterpriseServices.RegistrationHelper.InstallAssemblyFromConfig(RegistrationConfig& regConfig)
   at System.EnterpriseServices.RegistrationHelper.InstallAssembly(String assembly, String& application, String partition, String& tlb, InstallationFlags installFlags)
   at System.EnterpriseServices.RegistrationHelper.InstallAssembly(String assembly, String& application, String& tlb, InstallationFlags installFlags)
   at System.EnterpriseServices.RegistrationHelper.System.EnterpriseServices.Thunk.IThunkInstallation.DefaultInstall(String asm)
   at System.EnterpriseServices.Thunk.Proxy.RegisterAssembly(Assembly assembly)
   at System.EnterpriseServices.Thunk.Proxy.LazyRegister(Guid id, Type serverType, Boolean checkCache)
   at System.EnterpriseServices.Thunk.Proxy.CoCreateObject(Type serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String& uri)
   at System.EnterpriseServices.ServicedComponentProxyAttribute.CreateInstance(Type serverType)
   at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type serverType, Object[] props, Boolean bNewObj)
   at System.Reflection.RuntimeConstructorInfo.InternalInvoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at NUnit.Core.Reflect.Construct(Type type)
   at NUnit.Core.TestFixture.DoSetUp(TestResult suiteResult)


2 Responses to "NUnit, RegAsm, and “Failed to generate type library”"
  1. s with Two Factor Authentication where the One Time Password is generated and sent to the user via SMS or generated using a Hard Token (A small key which generates a new password after specific
    intervals of time. However, the thing to remember here is
    that you need to first take a backup before employing any extreme measures.

    However, if you know which hosting account to get, you can choose
    one with Cpanel included.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: