Welcome to MSDN Blogs Sign in | Join | Help

Andrew Whitechapel

Shiny things that caught my eye
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.

Posted: Monday, November 26, 2007 10:29 AM by andreww
Filed under: , ,

Attachment(s): WPF+WCF+LINQ_sampleCode v4.zip

Comments

Visual Studio 2008: Microsoft Visual Studio Tools for Office said:

A few months ago, Andrew Whitechapel wrote an article and sample application that demonstrates combining

# June 25, 2008 10:03 AM

ctaylor@infragistics.com said:

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!

# August 1, 2008 3:13 PM

andreww said:

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.

# August 1, 2008 4:19 PM

romysree said:

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

# August 14, 2008 4:04 PM

andreww said:

romysree - what's the exception trace?

# August 14, 2008 4:10 PM
New Comments to this post are disabled
Page view tracker