quinta-feira, 9 de janeiro de 2014

Migração do MVC 4 para 5


Após migrar um projecto asp.net MVC 4 para 5, começou a surgir a mensagem:

[MethodAccessException: Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.OnConnectionOpened(System.Object, WebMatrix.Data.ConnectionEventArgs)' to access security critical method 'System.Web.WebPages.HttpContextExtensions.RegisterForDispose(System.Web.HttpContextBase, System.IDisposable)' failed.]
   WebMatrix.WebData.PreApplicationStartCode.OnConnectionOpened(Object sender, ConnectionEventArgs e) +70
   WebMatrix.Data.Database.OnConnectionOpened() +70
   WebMatrix.Data.Database.EnsureConnectionOpen() +51
   WebMatrix.Data.Database.QueryValue(String commandText, Object[] args) +63
   WebMatrix.WebData.DatabaseWrapper.QueryValue(String commandText, Object[] parameters) +13
   WebMatrix.WebData.SimpleMembershipProvider.GetUserId(IDatabase db, String userTableName, String userNameColumn, String userIdColumn, String userName) +206
   WebMatrix.WebData.SimpleMembershipProvider.ValidateUserTable() +87


O qual resolvi através da instalação de Microsoft.AspNet.WebHelpers

Install-Package -Id  Microsoft.AspNet.WebHelpers

Este passo actualizou e retirou um conjunto de assemblies que penso que estariam na origem do problema! Nomeadamente

Successfully added 'Microsoft.AspNet.WebPages.Data 3.0.0' to eInvoice.
Successfully added 'Microsoft.AspNet.WebPages.WebData 3.0.0' to eInvoice.
...
Successfully uninstalled 'Microsoft.AspNet.WebPages.WebData 2.0.20710.0'.
Succcessfully uninstalled 'Microsoft.AspNet.WebPages.Data 2.0.20710.0'.




Assunto arrumado.

2 comentários:

Popular Posts

Arquivo

Etiquetas