0
我對ASP.NET MVC 5使用telerik域模型。當我在單元測試項目中使用上下文時,所有的東西都完美地工作。但是當我在MVC控制器使用它,我得到這個異常:Telerik OpenAccess ASP.NET MVC中的NULL引用
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.connect(ConnectionString connectionString, PropertySet driverProps, ConnectionPoolType poolType, LogEventStore pes)
at OpenAccessRuntime.Relational.sql.SqlDriver.InitializeFor(ConnectionString connectionString, Boolean noConnect, PropertySet props, DBDriver& driver, Connection& conn, ConnectionPoolType poolType)
at OpenAccessRuntime.Relational.RelationalStorageManagerFactory..ctor(StorageManagerFactoryBuilder b)
at OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createSmfForURL()
感謝
問題消失當我在MVC控制器上使用靜態數據庫上下文。 private static EntitiesModel _DbContext; 但我無法處理上下文了。我認爲這不是一個好的做法。謝謝 –