Tuesday, September 29, 2009

WPF Applications and the MVVM Pattern

Josh Smith has a great article on building WPF applications using the Model-View-ViewModel pattern in the February 2009 issue of MSDN magazine.

Also, Bryant Likes has post that summarizes other WPF/MVVM posts and articles.

[edit] Adding some additional links:

Josh Smith: Using a Service Locator to Work with MessageBoxes in an MVVM Application
Karl Shifflett:  M-V-VM
Dan Crevier:  List of Blog Posts
Jonn Gossman:  Tales from the Smart Client (1); Tales from the Smart Client (2)

Tuesday, September 22, 2009

.NET Assemblies

While chasing down the assembly binding error I mentioned in the previous post, I came across some useful links on .NET assemblies, covering such things as assembly binding (Fusion), changing/specifying assembly paths, strong naming, dynamically loading assemblies, native images and so on.  Richard Grimes has a tutorial here, Wikepedia has an entry on assemblies and CodeGuru has an article on strong naming.

.NET Assembly Binding Log Viewer

The other day, I was attempting to debug a VS 2008 project, but kept getting a error binding to a specific assembly (one of mine).  Despite the fact that my project had an explicit reference to version 3.x of dependent assembly (also located in the solution), Fusion (the .NET technology used to locate and load .NET assemblies) kept trying to load a previous version of the assembly.

In the course of trying to figure out the problem, I discovered the 'Assembly Binding Log Viewer' (Fuslogvw.exe), part of the Windows SDK, and found it to be highly useful in uncovering the problem.  MSDN's article on Fuslogvw is here and Neil Kilbride has a blog entry here.  For some reason which I don't yet understand, I had to set 'Log Categories' to 'Native Images' to get the info I needed.   Note that others have said the default disk log location (IE's cache) is problematic, so they recommend setting a custom log location--Click the 'Settings' button, check 'Enable Custom Log Path' and fill in 'Custom Log Path'.  You may also need to change 'Log Location' to 'Custom'.

Friday, September 11, 2009

VS 2008 Debugging Issue

Yesterday, I was using VS 2008 and attempting to debug a project by stepping code. Any attempt to step (F5, F10, etc) resulted in a dialog box telling me:

Edits were made which cannot be compiled. Execution cannot continue until the compile errors are fixed.

This problem can be fixed by turning off "Edit and Continue" in VS 2008. To do so, go to Tools->Options->Debugging->Edit and Continue. Uncheck "Enable Edit and Continue".

See also this thread.

Thursday, September 10, 2009

Exporting Hyper-V VMs to Network Shares

It is possible to export a Hyper-V VM directly to a network share, instead of having to export it locally and then copy. From Morgan Simonsen's post on Sunday, March 22, 2009 in this thread:

You can export to a network share if the user running the Hyper-V Manager on the source machine AND the source machine computer account have share AND file system permissions on the destination folder. This is also covered in the Hyper-V release notes and in Jose Barreto's Blog.

Problem solved...