0

We've got a couple of projects here at work. One uses MVC4 Beta and the other MVC4 RC.

I have MVC4 RC Installed on my local machine.

I need to be able to build both projects locally however the project using MVC4 Beta makes reference to System.Web.Http.SelfHost which has at least one method in beta that is not longer in RC.

How can I force the project using MVC4 Beta to use the dll we require rather than the MVC4 RC version in the GAC?

Jamie Dixon
  • 53,019
  • 19
  • 125
  • 162
  • If that method has been removed from the RC, it's for a reason. I would see why that method was removed and what workarounds/alternatives were put in place. The RC and then RTM versions are more stable, less prone to bugs. I realise its probably not the answer you want... but there is probably a good reason why it was removed. – Matthew Abbott Jul 13 '12 at 11:30
  • Absolutely @MatthewAbbott - Until the other team upgrade their work to RC I need to reference whatever they use. – Jamie Dixon Jul 13 '12 at 11:34

1 Answers1

2

You're playing with fire doing this but you would use a binding redirect in your web.config to specify the full version number you want to use in your web.config. The RC version and the Beta (depending which) Version have different version tags. YOu can specify which assembly to use that way.

http://msdn.microsoft.com/en-us/library/eftw1fys.aspx

HOWEVER, this is dangerous using the Beta version and I would even dare say dangerous using the RC version in a production environment. I hope that this is a QA environment and you are planning to wait for RTM to go to production. Beta code should never be used in a production environment, read the EULA you agreed to when installing ;-)

VulgarBinary
  • 3,520
  • 4
  • 20
  • 54
  • Thanks. The project that's having the issue is a unit test project so there's no web.config in there. It makes reference to the SelfHost dll and uses some methods that don't exist in RC. Can we do something similar? – Jamie Dixon Jul 13 '12 at 11:43
  • I'm testing this using the app.config to see if i can point it to the reference I require. – Jamie Dixon Jul 13 '12 at 11:51
  • App.config or Web.config will have the same approach. You'll be able to specify the binding redirect in either configuration file. Hope it all works out for you! – VulgarBinary Jul 13 '12 at 12:00