VSTO + WPF + WCF + LINQ (MSDN Article)


There's an article in this month's MSDN magazine on building Office-based solutions using VSTO with WPF, WCF and LINQ. The point of the article is to affirm that all these disparate technologies do indeed work well together, and that the design-time experience of building such a solution is suitably RAD. The article is also online here.


Right now, the accompanying sample code download is unfortunately an early version that doesn't match the article (thanks to Andy Cheung for pointing this out). The posted version of the code also doesn't work with the final release version of VS 2008. I'm working with the gentle folks at MSDN to fix this as soon as possible. Meanwhile, I've attached an updated version of the code to this post – this version does work with VS 2008 RTM.

WPF+WCF+LINQ_sampleCode v4.zip

Comments (5)
  1. A few months ago, Andrew Whitechapel wrote an article and sample application that demonstrates combining

  2. ctaylor@infragistics.com says:

    Thanks for posting the code for this. It is very helpful for learning about using WPF/WCF/LINQ in VSTO. It is also a great sample how to create a VSTO addin. I’m very new to VSTO dev. In this sample, would I need to explicitly add the output DLLs and Image folder to the Program Files Office Addin folder? And once installed, where does this addin appear in the UI for an app like Word or Excel?

    Thanks!

  3. Garry Trinder says:

    ctaylor – thanks for your comments. The add-in picks up the image files from the same folder that the assembly is executing from, so you’d just need to deploy them there – and it doesn’t matter where that is, because the registry will point to the manifest which points to the location. All this is taken care of if you use the Publish feature to deploy your add-in. Alternatively, you can use a standard setup (MSI) project.

    I’m not sure what you mean by "where does this addin appear in the UI". This particular add-in shows a custom task pane, which appears at the bottom (in this case) of the Word window. In general, all add-ins are listed in the COM Add-ins dialog in the Office UI, which is accessible from the Office Trust Center.

    For details, you should start with the VSTO developer portal here: http://msdn.microsoft.com/en-us/office/aa905533.aspx. VSTO MSDN documentation is here: http://msdn.microsoft.com/en-us/library/d2tx7z6d.aspx. VSTO deployment details are here: http://msdn.microsoft.com/en-us/library/bb772100.aspx.

  4. romysree says:

    Andrew,

    Good article.

    I am still unable to run your WCF service. I get the following at

    ServiceHost svcHost = new ServiceHost(typeof(ImageService));

    error is –

    {"The type initializer for ‘System.ServiceModel.DiagnosticUtility’ threw an exception."}

    Romy

  5. Garry Trinder says:

    romysree – what’s the exception trace?

Comments are closed.

Skip to main content