I got this error in an ASP.NET MVC 4 application after installing DotnetOpenAuth via the Package Manager Console:
Could not load file or assembly 'DotNetOpenAuth.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
The application was actually upgraded earlier from ASP.NET MVC 3, i.e. it was not autogenerated by Visual Studio 2012. The pre-binding info in the exception was:
=== Pre-bind state information ===
LOG: User = NT AUTHORITY\NETWORK SERVICE
LOG: DisplayName = DotNetOpenAuth.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246
(Fully-specified)
LOG: Appbase = file:///
LOG: Initial PrivatePath = \bin
Calling assembly : Microsoft.Web.WebPages.OAuth, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: \web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: DotNetOpenAuth.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246
LOG: Attempting download of new URL file:////DotNetOpenAuth.Core.DLL.
LOG: Attempting download of new URL file:////DotNetOpenAuth.Core/DotNetOpenAuth.Core.DLL.
LOG: Attempting download of new URL file:////DotNetOpenAuth.Core.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
The key pieces of information here are at lines 3 and 7. Basically, Microsoft.Web.WebPages.OAuth needs DotNetOpenAuth.Core 4.0.0.0, but the DotNetOpenAuth.Core I have is version4.3.0.0.
The solution is to add these lines under the / section of the root Web.config:
The above solution works for other packages that ASP.NET MVC 4 depends on. For example, if you upgrade WebGrease from 1.0.0.0 to 1.3.0.0, you have to add this to the / section:
I recently had to update a web application from ASP.NET MVC 3 to ASP.NET MVC 4. Here are the the steps I had to go through to do that:
1) Update your project references. The easiest way to do that is to install ASP.NET MVC 4.0 from Package Manager Console:
Install-PackageMicrosoft.AspNet.Mvc
That will download and install all necessary components and will update your project references.
2) In your root Web.config, in <system.web> / <assemblies> section, update the assembly versions for System.Web.Helpers, System.Web.Mvc and System.Web.WebPages, i.e. replace this:
3) In Views\\Web.config, replace all instances of System.Web.Mvc, Version=3.0.0.0 and System.Web.WebPages.Razor, Version=1.0.0.0 with System.Web.Mvc, Version=4.0.0.0 and System.Web.WebPages.Razor, Version=2.0.0.0.
Those three basic changes were enough to get my web application running. Depending on your application you may have to do more changes. For a complete list of all changes that might be required, check out the upgrade section in the ASP.NET MVC 4 release notes.
I have been doing some scripting in PowerShell 3.0 lately and I found this post by Scott Hanselman. Just go to that post and download powershellhere.inf, right click on it and click Install. It will give you a nice “PowerShell Prompt Here” context menu in Windows Explorer.
The easiest way to do that is to download and install the Mercurial 2.5.4 for OS X 10.8 binary package from the official Mercurial site. After downloading the file unzip it and open mercurial-2.5.4+20130405-py2.7-macosx10.8.mpkg.
There are a few ways to do this, but the best is via [ui] and [auth] sections in .hgrc (in your home directory). Your final .hgrc file should look like this:
Go to www.sourcetreeapp.com and download SourceTree for Mac. At the time of this writing the latest version of SourceTree was 1.5.8. SourceTree for Mac comes packaged as a dmg file – after you open the dmg file you install the app the normal Mac way – by dragging SourceTree.app into your Applications folder.
I recommend configuring SourceTree to use the system Mercurial. That way you get consistent Hg experience when working in Terminal and in the SourceTree GUI. To do that, run SourceTree and press “Command + ,” to open Preferences and then click Use System Mercurial.