Search
Monday, November 12, 2018 ..:: Home ::.. Register  Login
   Calendar  
     
  
   Search  
     
  
   Blogroll  
     
  
   Disclosure  
All blog entries are the opinions of the author and do not necessarily reflect the opinions of their employer. All the code presented is for explanation and demonstration purposes only. Any damages incurred to your site and/or data are not the responsibility of the author. Every effort is taken to ensure the code properly compiles, however sometimes there are some hiccups and you might be required to do your own debugging.
     
  
   TechTidBits (Blog)  

Unable to get an MVVMLight project working after doing a merge with source control?

Mar 23

Written by:
Sunday, March 23, 2014 2:29 PM  RssIcon

imageDid you just merge a bunch of changes in source control, but now your project won’t compile?  Getting a bunch of GalaSoft namespaces not being referenced errors upon compiling?  I think I have something you can try to help!

Last week, I worked on an older code branch.  Later in the week, we merged a bunch of work into the main\current code branch.  My boss did most of the work, but after many comparing TFS DataSets, merges, checkins, rinse and repeat….the project wouldn’t work.  HUH?  If you’re doing A BUNCH (ie LOTS) of code merges that happened over many days\weeks (hey, you’ve done it too, don’t judge LOL) you sometimes skip the F6 (Compile) step just to keep plugging along to get the task\job done. 

Well, Fri, I went to try things out (F5ing) but …..DOH!……Errors

1.MissingReferences

Ok, go look at the References for the project.  Huh?  Where’d the MVVMLight refs goto from GalaSoft?  Huh?

image

Ok, I know NUGET is new to me, buuuuuuuuut.  Ok, not time to panic yet, go look at the nuget manage packages tool.  DOH!  It SAYS it’s supposed to be there!

2.ButMvvmLightIsReferenced

Ok, maybe, something got screwed up in the merging?  Possible.  So lets go and reinstall the nuget package.

3.MvvmLightAlreadyReferenced

DOH!  Already installed.  Ok, ok, let’s go back to basics, we’ll just uninstall mvvmlight package and then reinstall it.  Hey, it’s not working now, what’s the worst that can happen?  (Don’t answer that!!!!!!!!!!!! LOL)

4.ManuallyUninstall

In the nuget Package Manager Console, type out what’s on the first line (uninstall-package mvvmlight).  There’s another one there cause I might have done that second one while doing previous testing above, so I thought I would uninstall it for completeness.  If we go look at the Manage NuGetPackages program, you should see it not listed, this is good, although your heart just skipped a beat, I know, I know, don’t worry, just keep going\reading!

5.AfterManuallyUninstalling

Next, go into the Package Manager Console and install the mvvmlight again! (install-package mvvmlightlibs) I did the libs cause…….I picked one and I wanted the smallest piece available (you now know how to “fix” this if you wanted the other one, you know how to uninstall this one and install the other one).

6.ManuallyReinstallingMvvmLight

Ok, NOW let’s go check the project references to see if they’re listed now?  BINGO!!!!!!!!!!!!!!!!!!!!!!!!!!  AWESOME!  BUT!  The proof, the REAL proof is for the F6 for compiling!!!!!!!!!  YUP!  Works like a charm!

 7.THEREWeGo

COOL!  Now that you know how to FIX this, what COULD be the source of the problem?  I think it might be related to the merge activity, TFS hiding certain files, and maybe nuget not counting certain files in the merge?  For example, I noticed the merge didn’t pick up the packages.config file for nuget, but when I did the package install, it did.  Maybe that could be it?

8.OneMoreChange

Cool!  Now you know to “fix” a project that’s not compiling from a missing mvvmlight nuget package\reference, it’s time to grab a coffee and get coding!

Tags:
Categories:
Location: Blogs Parent Separator TechTidBits

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
     
  
Copyright 1999-2012 by PCHenry.com   Terms Of Use  Privacy Statement