Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Upgrading to the latest MVC causes error
Message
 
 
À
24/02/2015 08:47:25
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01615733
Message ID:
01615786
Vues:
24
>>>The actual routing table is created dynamically at startup and it seems that this can't be constructed if the ErrorView() (or other) methods are generic.
>>>What's your signature of ErrorView() ?
>>>
>>
>>I posted it in another reply but here it's again:
>>
>>
public PartialViewResult ErrorView<T>(T viewModel, string viewName, string message, string errorProperty = "") where T : BaseEditViewModel
>
>Could you just use:
>
public PartialViewResult ErrorView(BaseViewModel viewModel, string viewName, string message, string errorProperty = "")
>
>

Each controller is using its own model which is based on the BaseViewModel but as a subclass. Will it work?

>>
>>Similar signatures for other methods, so I commented them as well. Now I'll try to uncomment them and comment just that line instead.
>>
>>>>I can, of course, try to change the target .NET framework to be 4.5, don't think it will help.
>>>>
>>>>I've checked few projects in the solution and it says that it's targeting .NET 4.5.1. So why it's showing 4.0 version of the framework?
>>>
>>>Showing where ?
>>
>>At the very bottom of the error page:
>>
>>....
>>[HttpException (0x80004005): Cannot call action method 'System.Web.Mvc.PartialViewResult ErrorView[T](T, System.String, System.String, System.String)' on controller 'SysManager.Web.Areas.AccountingAudit.Controllers.PaymentTypesController' because the action method is a generic method.
>>Parameter name: methodInfo]
>> System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9955652
>> System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
>> System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
>>
>>________________________________________
>>Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34237
>
>What's the targetFramework in web.config ?

This is in the web.config:
 <compilation debug="true" targetFramework="4.5.1">
       <assemblies>
         <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
       </assemblies>
    </compilation>
    <httpRuntime targetFramework="4.5"/>
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform