2015-03-17 10 views
8

Ön sürüm ASP.net vNext altında EF6'yı çalıştırmak mümkün mü? EF7'nin ihtiyacım olan bazı özellikleri yok, ancak uygulamanızı .NET Core'da prototiplemek istiyorum.ASP.net vSonraki ve Varlık Çerçevesi 6

aşağıdaki hatayı alıyorum:

FileLoadException: A strongly-named assembly is required. 
(Exception from HRESULT: 0x80131044) Unknown location 

FileLoadException: Could not load file or assembly 
'EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089' or one of its dependencies. 
A strongly-named assembly is required. (Exception from HRESULT: 0x80131044) 

Ben .NET Çekirdek şiddetle adlandırılmış derlemeler desteklemediğini biliyorum ama bildiğim kadarıyla ben aspnet50 çerçevesinde sunucuyu koşuyorum bildiği gibi aspnetcore50 yerine.

{ 
    "webroot": "wwwroot", 
    "version": "1.0.0-*", 
    "dependencies": { 
     "EntityFramework": "6.1.1", 
     "Microsoft.AspNet.Mvc": "6.0.0-beta3", 
     /* "Microsoft.AspNet.Mvc.WebApiCompatShim": "6.0.0-beta3", */ 
     "Microsoft.AspNet.Diagnostics": "1.0.0-beta3", 
     "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta3", 
     "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta3", 
     "Microsoft.AspNet.Security.Cookies": "1.0.0-beta3", 
     "Microsoft.AspNet.Server.IIS": "1.0.0-beta3", 
     "Microsoft.AspNet.Server.WebListener": "1.0.0-beta3", 
     "Microsoft.AspNet.StaticFiles": "1.0.0-beta3", 
     "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta3", 
     "Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta3", 
     "Microsoft.Framework.Logging": "1.0.0-beta3", 
     "Microsoft.Framework.Logging.Console": "1.0.0-beta3", 
     "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta3", 
     "Tricycle.SqlPlatform.EntityFramework": "1.0.0-*" 
    }, 
    "commands": { 
     /* Change the port number when you are self hosting this application */ 
     "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000", 
     "gen": "Microsoft.Framework.CodeGeneration", 
    }, 
    "frameworks": { 
     "aspnet50": { 
      "dependencies": { 
       "Tricycle.Studio.ContentManager.Client": "1.0.0-*" 
      } 
     }, 
     //"aspnetcore50": { } 
    }, 
    "exclude": [ 
     "wwwroot", 
     "node_modules", 
     "bower_components" 
    ], 
    "bundleExclude": [ 
     "node_modules", 
     "bower_components", 
     "**.kproj", 
     "**.user", 
     "**.vspscc" 
    ], 
    "scripts": { 
     "postrestore": [ "npm install" ], 
     "prepare": [ "grunt bower:install" ] 
    } 
} 

sınıflar aşağıdaki project.json ayrı bir proje (Tricycle.Studio.ContentManager.Client) tanımlanmıştır EF:

{ 
    "version": "1.0.0-*", 
    "dependencies": { 
     "EntityFramework": "6.1.1", 
    }, 

    "frameworks": { 
     "aspnet50": { 
      "dependencies": { 
       "System.Data.Common": "1.0.0-beta2", 
       "System.Data.SqlClient": "1.0.0-beta2" 
      } 
     }, 
     //"aspnetcore50" : { 
     // "dependencies": { 
     //  "System.Runtime": "4.0.20-beta-22523" 
     // } 
     //} 
    } 
} 

cevap

9

Benim project.json şöyle

EF7'ye bağlı olduğundan, EF6 ile Microsoft.AspNet.Identity.EntityFramework kullanamazsınız.

project.json dosyanıza göre, çalışma zamanı hem EF6 hem de EF7 (Kimlik nedeniyle) yüklenir. Davranış tahmin edilemez. Ayrıca, beta2 ve beta3 paketlerini de karıştırmayın. Bu garantili bir sorun.

+0

Teşekkürler! Microsoft.AspNet.Identity.EntityFramework'ın kaldırılması onu düzeltmiş gibi görünüyor. Beta2/3 ile ilgili olarak - bu paketler yalnızca beta2'de mevcut görünüyor. – Grokys

+0

Ah, güzel bul, @Victor. Yeni başlayan tüm yeni oyuncaklar bunu göz ardı etti. +1 –