This project is read-only.

T4MVCExtensions.dll depends on System.Web.Mvc

Jan 8, 2014 at 3:34 PM
Hi all,

I had a problem running unit tests on Jenkins. We have analyzed it and found out that T4MVCExtensions.dll tries to reference System.Web.Mvc, but our project already uses one.
On development machine this is not a problem because is in GAC, however on Jenkins there is no version in GAC.
Once we built locally T4MVCExtensions.dll against System.Web.Mvc then Jenkins started to work.
Would it be possible to release T4MVCExtensions.dll which depends on System.Web.Mvc
Jan 8, 2014 at 7:34 PM
"On development machine this is not a problem because is in GAC": actually the more likely reason it's not a problem is that the binding redirects in your web.config cause it to bind to 4.0 even though it references 3.0. It would work even if 3.0 wasn't in your GAC.

So the question is whether there is a way to apply similar binding redirects with Jenkins.

If not, I'm not sure what the best way would be. People use MVC 3, 4 and 5 in various apps. If it means having 3 different NuGet packages, it gets pretty painful.
Jan 10, 2014 at 12:21 PM
Edited Jan 10, 2014 at 12:22 PM
The problem was that NUnit test was running from name.nunit file. In this case test.dll.config file is ignored. And also redirection defined in test.dll.config is ignored.
The solution is to copy test.dll.config (with redirection) next to name.nunit file and rename it to name.config
Then it works also on Jenkins (not to forget I run it with -noshadow option as well).
Marked as answer by zliecho on 1/10/2014 at 4:21 AM
Jan 10, 2014 at 4:59 PM
Great, thanks for sharing details on how you made it work, which might come handy to others later!