TFS Build server and COM references – does this work?

Using tlbimp.exe directly is not necessary. Try replacing any <COMReference> items in the project file with <COMFileReference>. An example would look like this: <ItemGroup> <COMFileReference Include=”MyComLibrary.dll”> <EmbedInteropTypes>True</EmbedInteropTypes> </COMFileReference> </ItemGroup> The COM dll doesn’t need to be registered on the machine for this to work. Each COMFileReference item can also have a WrapperTool attribute but the … Read more

Excel 2007 automation on top of a Windows Server 2008 x64

The solution is really simple. The msdn forum thread can be found here To make a long story short I’m posting the solution here, credit goes to H Ogawa This solution is … ・Windows 2008 Server x64 Please make this folder. C:\Windows\SysWOW64\config\systemprofile\Desktop ・Windows 2008 Server x86 Please make this folder. C:\Windows\System32\config\systemprofile\Desktop …instead of dcomcnfg.exe. This … Read more

Use Office Interop on MVC6 website

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment. If you are building a solution that runs in a server-side … Read more

How to call a complex COM method from PowerShell?

This problem did interest me, so I did some real digging and I have found a solution (though I have only tested on some simple cases)! Concept The key solution is using [System.Type]::InvokeMember which allows you to pass parameter names in one of its overloads. Here is the basic concept. $Object.GetType().InvokeMember($Method, [System.Reflection.BindingFlags]::InvokeMethod, $null, ## Binder … Read more