MSBuild failed at resolving COM reference. Why?

3

My build server suddenly stopped working. After I examined log files I found monster error message:

 error MSB4018: The "ResolveComReference" task failed unexpectedly.
 error MSB4018: System.ApplicationException: The directory name is invalid. (Exception from HRESULT: 0x8007010B)
 error MSB4018: 
 error MSB4018: Server stack trace: 
 error MSB4018:    at System.Reflection.Assembly.nDefineVersionInfoResource(String filename, String title, String iconFilename, String description, String copyright, String trademark, String company, String product, String productVersion, String fileVersion, Int32 lcid, Boolean isDll)
 error MSB4018:    at System.Reflection.Emit.AssemblyBuilder.SaveNoLock(String assemblyFileName, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
 error MSB4018:    at System.Reflection.Emit.AssemblyBuilder.Save(String assemblyFileName, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
 error MSB4018:    at Microsoft.Build.Tasks.TlbReference.WriteWrapperToDisk(AssemblyBuilder assemblyBuilder, String wrapperPath)
 error MSB4018:    at Microsoft.Build.Tasks.TlbReference.GenerateWrapper(ComReferenceWrapperInfo& wrapperInfo)
 error MSB4018:    at Microsoft.Build.Tasks.ResolveComReference.ResolveComReferenceTlb(ComReferenceInfo referenceInfo, StringoutputDirectory, String refName, Boolean topLevelRef, ComReferenceWrapperInfo& wrapperInfo)
 error MSB4018:    at Microsoft.Build.Tasks.ResolveComReference.ResolveComClassicReference(ComReferenceInfo referenceInfo, String outputDirectory, String wrapperType, String refName, Boolean topLevelRef, ComReferenceWrapperInfo& wrapperInfo)
 error MSB4018:    at Microsoft.Build.Tasks.ResolveComReference.Microsoft.Build.Tasks.IComReferenceResolver.ResolveComClassicReference(TYPELIBATTR typeLibAttr, String outputDirectory, String wrapperType, String refName, ComReferenceWrapperInfo& wrapperInfo)
 error MSB4018:    at Microsoft.Build.Tasks.ResolveComReference.ScanAndResolveAllDependencies(ComDependencyWalker dependencyWalker, ComReferenceInfo reference)
 error MSB4018:    at Microsoft.Build.Tasks.ResolveComReference.ResolveReference(ComDependencyWalker dependencyWalker, ComReferenceInfo referenceInfo, String outputDirectory, ITaskItem& referencePathItem)
 error MSB4018:    at Microsoft.Build.Tasks.ResolveComReference.ResolveReferenceAndAddToList(ComDependencyWalker dependencyWalker, ComReferenceInfo projectRefInfo, ArrayList resolvedReferenceList, ArrayList moduleList)
 error MSB4018:    at Microsoft.Build.Tasks.ResolveComReference.Execute()
 error MSB4018:    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
 error MSB4018:    at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
 error MSB4018:    at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
 error MSB4018: 
 error MSB4018: Exception rethrown at [0]: 
 error MSB4018:    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
 error MSB4018:    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
 error MSB4018:    at Microsoft.Build.Framework.ITask.Execute()
 error MSB4018:    at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)

All errors are from c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1418,9).

Obviously there are some problems with COM references. I tried reregister all of them but I didn't succeed.

How can I find troubled reference or at least how can I diagnose this problem?


Edit: When I build application locally and copy it to the server it works. So there is problem with something that's needed only for build.

.net
msbuild
asked on Stack Overflow Aug 30, 2010 by Jakub Šturc • edited Aug 30, 2010 by Jakub Šturc

2 Answers

2

The directory name is invalid

That's your real problem.

answered on Stack Overflow Aug 30, 2010 by Hans Passant
1

Process Monitor reveals that last reasonable thing what MSBuild did was looking for interop library for stdole.dll in project output folder. This confuse me event more because my project doesn't have direct dependency on that dll.

Finally I restarted server and everything works fine. Shame on me. I should tried restart first.

answered on Stack Overflow Aug 30, 2010 by Jakub Šturc

User contributions licensed under CC BY-SA 3.0