开发者

"The invoked member is not supported in a dynamic assembly." after upgrading web app from .NET 3.5 to 4.0

I'm attempting to move from VS2008 to VS2010 and want to also upgrade the website to .NET 4.0. I've copied the source over and ran the conversion wizard with no errors. There were also no compile errors as well. However, right when the page loads I get the exception:

System.NotSupportedException was unhandled by user code
  Message=The invoked member is not supported in a dynamic assembly.
  Source=mscorlib
  StackTrace:
       at System.Reflection.Emit.InternalAssemblyBuilder.get_Location()
       at CoreLab.Common.o.a(Assembly A_0)
       at CoreLab.Common.v.a(LicenseContext A_0, Type A_1, String& A_2, String& A_3, String& A_4)
       at CoreLab.Common.v.a(LicenseContext A_0, Type A_1, String& A_2, Boolean& A_3, String& A_4, String& A_5)
       at CoreLab.Common.v.a(LicenseContext A_0, Type A_1, Boolean A_2)
       at CoreLab.Oracle.OracleProviderFactory.CreateConnection()
       at System.Data.EntityClient.EntityConnection.GetStoreConnection(DbProviderFactory factory)
       at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
       at System.Data.EntityClient.EntityConnection..ctor(String connectionString)
       at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)
       at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)
       at VZW.TrainingPortfolioManager.Entity.TPMEntities..ctor(String connectionString) in C:\TPM_NET4\Entity\TPMEntities.Designer.cs:line 114
       at VZW.TrainingPortfolioManager.Website.Global.Session_Start(Object sender, EventArgs e) in C:\TPM_NET4\Website\Global.asax.cs:line 110
       at System.Web.SessionState.SessionStateModule.RaiseOnStart(EventArgs e)
       at System.Web.SessionState.SessionStateModule.CompleteAcquireState()
       at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
       at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
  InnerException: 

The error happens in code auto-generated by the ADO.NET Entities Framework in the constructor:

/// <summary>
/// Initialize a new TPMEntities object.
/// </summary>
public TPMEntities(string connectio开发者_如何学运维nString) : base(connectionString, "TPMEntities")
{
    OnContextCreated();
}

The exception happens when calling into the base constructor.

Was there some changes made in the entity framework for .NET 4.0 that would require me to do something different or change anything? I'm pretty much at a loss here. Thanks!


This issue ended up being due to a bug in the version of the Oracle database driver I was using. I confirmed this with DevArt, and obtained a new version which fixes this bug.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜