I get the following error when I start my asp net mvc 4 application:
Could not load file or assembly \'DotNetOpenAuth.Core, Version=4.0.0.0,
Culture=neutral
I had similar problem. It was really strange as the project was running OK a day before.
Removing obj and bin folders from the project folder, cleaning the solution and rebuilding it worked.
Hope that helps.
Just select "Remove additional files at destination" on publish settings. This works for me
Try doing a global solution search (ctrl+shift+f if you haven't changed it) for the value '2780ccd10d57b246'. I'm guessing you'll find it in your web.config.
One more solution option is to have assembly dependency as follows:
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.AspNet"
publicKeyToken="2780ccd10d57b246"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.Core"
publicKeyToken="2780ccd10d57b246"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
I do not have the reputation to comment but I can verify that I had this exact problem and Jack gave the correct solution for me. I had recently pressed Add Service Reference and it broke the program with the above error message.
Deleting the _bin_deployableAssemblies folder, and your application's bin folder and then clean and rebuild your application made it work again.
For me helped adding to csproj file the following section:
<PropertyGroup>
<PostSharpHostConfigurationFile>web.config</PostSharpHostConfigurationFile>
</PropertyGroup>