Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3306956
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:21:00+00:00 2026-05-17T21:21:00+00:00

I have read this post and I wanted to use ControllerExtensions.RedirectToAction method. But I

  • 0

I have read this post and I wanted to use ControllerExtensions.RedirectToAction method. But I have System.Security.VerificationException Which says: type argument ‘[MyController type]’ violates the constraint of type parameter ‘T’.

My controller is declared as follows:

   public class ProductsSearchController : Controller
   {
        ...
   }

Help me, please.
Also I tried to download the latest MvcContrib library from here. It didn’t help me.

I noticed an interesting fact. I have this exception only when calling from unit tests. But there is no exception when using from web site. However it seems not working correctly. When I pass an object to the action in expression like this:

this.RedirectToAction(x => x.Index(filter))

it just call .ToString of this object! And I get url like this:

ProductsSearch?filter=WebShop.FinderModel.Filters.ProductsFilter

What is wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:21:00+00:00Added an answer on May 17, 2026 at 9:21 pm

    I’ve been having this problem.

    I was using MvcContrib version 2.0.95.0 alongside System.Web.Mvc version 4.0.30319.

    The problem was that MvcContrib references an earlier version of System.Web.Mvc.

    If you’re using an older version of MvcContrib with Mvc 2 it should be sufficient to download and reference the latest version of MvcContrib. If you’re using .NET 4 and Mvc 3 you’ll need to update the App.Config file for your unit test project (you may have to add one) with the following:-

    <configuration>
    ...
    
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    
    ....
    </configuration>
    

    Bear in mind that you may need to change the version numbers if you’re using a different version of MVC. (e.g. at the time of this edit you’d need to use oldVersion="1.0.0.0-5.1.0.0" and newVersion="5.2.0.0").

    You may also need to add this to your web project. If you’re only getting the exception in your test project, chances are this section already exists and is correct in your web.config; you can copy and paste it from there.

    If you’re using Code Analysis, you’ll also need to see Assembly Binding Redirection and Code Analysis in order for it to respect the binding redirection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read this post about how to test private methods. I usually do
I have read this question but it's not quite what I was looking for.
I have read over this which sort of gives an explanation of when you'd
I have read from this article http://codahale.com/how-to-safely-store-a-password/ and it says using a salt isn't
I have read this post and it doesn't answer my question. Stateless session bean
I have already read this post: Making TextView scrollable on Android without success. My
I have read this post and it didn't really help. My php.ini file (
I have read this article from High Scalability about Stack Overflow and other large
I have read this article about 400% boost of your website . This is
I have read this. Jquery checkbox <input type=checkbox name=checkGroup id=all> <input type=checkbox name=checkGroup id=one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.