0

Does anyone know if this is possible? I can get it to work OK if I build for 4.0 compatibility but when I use 4.5 all my tests fail with the familiar;

System.Security.VerificationException: Method Microsoft.Web.Mvc.Internal.ExpressionHelper.GetRouteValuesFromExpression: type argument 'T' violates the constraint of type parameter 'TController'

Which I believe is due to a mismatched version of MVC. I've tried adding a binding redirect in the config for 4.5 but as I'd anticipate that didn't seem to work.

Thiem Nguyen
  • 6,345
  • 7
  • 30
  • 50
cirrus
  • 5,624
  • 8
  • 44
  • 62
  • Do you get this error when the T4 template is processed (e.g. when you save it), or when you run the app? Do you have a full stack trace? – David Ebbo Jun 18 '12 at 22:00
  • Well it was running the unit tests. I've pulled all the T4MVC in the meantime as I wanted to stick with 4.5. Are you saying you'd expect it to work? – cirrus Jun 19 '12 at 09:06
  • I'm not aware of an issue. Doesn't mean there isn't one. Can you include a full stack trace? – David Ebbo Jun 19 '12 at 17:25
  • I just did a quick test with .NET 4.5 and it seems to work fine for me. Would need a more complete repro. – David Ebbo Jun 19 '12 at 23:06
  • Thanks David, let me get to a stable checkin and I'll try adding back to the project and see if I can repro. If so, I'll try and repro with a clean project. I did have some mixed 4.0 and 4.5 in the same solution early on but I was fairly sure it was consistent when I tested. Now azure is up to 4.5 I'm all 4.5 now, but it could be a mismatch between some other 3rd party NuGet package, although I'm not sure what would be loading MVC. – cirrus Jun 20 '12 at 09:04
  • If you get a reliable repro, please e-mail me at bradwils at microsoft dot com. Thanks! – Brad Wilson Jun 28 '12 at 19:29
  • OK. I just got around to re-testing this. I just downloaded 2.9.0 with NuGet and it gave me the Serialization error at first. I ran the custom tool option over it and it seemed to build but now the generated classes are saying that my Controllers do not have a constructor that take 0 parameters (I'm using DI). – cirrus Jul 02 '12 at 23:05

0 Answers0